EFS implementation
EFS implementation:
To install and mount the EFS service on instances:
Set up your EC2 instance:
Open an SSH client and connect to your EC2 instance.
If you're using an Amazon Linux EC2 instance, install the EFS mount helper with the following command:
sudo yum install -y amazon-efs-utils
You can still use the EFS mount helper if you're not using an Amazon Linux instance. [https://docs.aws.amazon.com/console/efs/efs-utils Learn more
]If you're not using the EFS mount helper, install the NFS client on your EC2 instance:
On a Red Hat Enterprise Linux or SUSE Linux instance, use this command:
sudo yum install -y nfs-utilsOn an Ubuntu instance, use this command:
sudo apt-get install nfs-common
Mounting your file system:
Open an SSH client and connect to your EC2 instance.
Create a new directory on your EC2 instance, such as "efs".
sudo mkdir efs
Mount your file system with a method listed following. If you need encryption of data in transit, use the EFS mount helper and the TLS mount option. Mounting considerations
Using the EFS mount helper:
sudo mount -t efs fs-641191b5:/ efsUsing the EFS mount helper and the TLS mount option:
sudo mount -t efs -o tls fs-641191b5:/ efsUsing the NFS client:
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-641191b5.efs.ap-south-1.amazonaws.com:/ efs
fstab entry:
#sudo nano /etc/fstab
Add this blow command in the fstab file.
fs-641191b5.efs.ap-south-1.amazonaws.com:/ /efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0
- sudo umount /efs
#sudo mount -a
=================================================================
Configure EFS Service on AWS:
Client Access on EFS Service: Json policy for efs mount point:
{
“Version”: “2012-10-17",
“Id”: “efs-policy-wizard-11fe09cb-fb8e-4a19-b885-f9c40de142be”,
“Statement”: [
{
“Sid”: “efs-statement-ac2c79e7-66d2-4f5e-8087-f628b3a6993d”,
“Effect”: “Allow”,
“Principal”: {
“AWS”: “*”
},
“Action”: [
“elasticfilesystem:ClientMount”,
“elasticfilesystem:ClientWrite”,
“elasticfilesystem:ClientRootAccess”
],
“Resource”: “arn:aws:elasticfilesystem:ap-south-1:558085067009:file-system/fs-4531b194"
}
]
}