Amazon EFS

Amazon EFS can be used to mount same drive on multiple EC2 instances allowing you to make web site scale on multiple web servers.

To mount EFS drive on Ubuntu, you need to install

apt-get -y install nfs-common

To mount a EFS drive, run

mkdir /efs
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-YOUR-ID.efs.us-east-1.amazonaws.com:/ /efs

Here is fstab entry for auto-mount efs on boot. Here it is mounted /efs, all website files reside in EFS.

root@ip-10-0-0-224:~# cat /etc/fstab 
LABEL=cloudimg-rootfs   /    ext4   defaults,discard    0 0
fs-4fg8d351.efs.us-east-1.amazonaws.com:/ /efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0
root@ip-10-0-0-224:~# 

Or

fs-a27131eb.efs.us-east-1.amazonaws.com:/ /efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0

Create Dummy Data in Amazon EFS

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *