Working with EFS (Elastic File System)
Date Posted:
EFS is a aws service which is similar to NFS service where we can add a single disk across multiple servers. The advantage of using EFS is we dont have to worry about data storage.
Limitation:
- EFS has a limited to few regions as of now and it doesn’t support it all regions.
- An EFS volume can be used within the region and the volume cannot be mounted to other regions.
EFS Creation:
Logon to Amazon Management Console
Click on Create File System
Select VPC, under Create mount targets, select availability zones and security groups as default.
Mention the Name of the key and select Choose performance mode as General Purpose
We will get DNS name for the EFS volume
Mounting EFS volume to Instance/server:
If we followed the steps properly, default security group would be selected. Let’s install nfs utility on the host.
For Ubuntu,
apt-get install nfs-common
For Centos,
yum install -y nfs-utils
Create a directory or mount to an existing partition. In our example, we are going to mount the partition to /var/www/html
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 EFS-DNSNAME:/ /var/www/html
Add the permanent entry on /etc/fstab
vi /etc/fstab
DNSNAME-:/ /var/www/html nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0
Replace DNSNAME with EFS endpoint.
Post your queries incase of any issues.