Introduction
Steps to create EFS from console and mount EFS in EC2, main focus will be on EFS
Create security group for EFS
- EFS is using NFS version 4.0 and 4.1, so we must create a security group to allow tcp 2049 port accessible to EFS
When creating security group for EFS, we can select the source allow to access EFS which the security group for EC2 will be selected
- Finished SG view of EFS
Create EFS
Make sure the correct VPC, subnet and SG is selected
Remove the default SG and select the EFS SG
Rest of steps to complete EFS, configure accordingly
Finshed view of EFS configuring
- EFS creating and finished
Steps to mount EFS to EC2
- Follow the provided instructions
Install necessary package
- Follow the instruction to mount the EFS mounting target
Login to EC2 and mount EFS mounting target
Install necessary package
Mount EFS mounting target
Mount EFS mounting target automatically after reboot
- Modify
/etc/fstab
as bellow, reboot to confirm1 2
sudo sh -c "cat >> /etc/fstab" your_EFS_file_system_id mount_point efs defaults,_netdev 0 0
- EFS auto mounted after reboot
Checking EFS statistics with CloudWatch
- test and monitor EFS with command bloew, replace the
mounting point
1
sudo fio --name=fio-efs --filesize=10G --filename=/`ur_mount_point`/fio-efs-test.img --bs=1M --nrfiles=1 --direct=1 --sync=0 --rw=write --iodepth=200 --ioengine=libaio
Enter CloudWatch console
Select metrics to be monitor
- Set configuration according to needs and check the result graphp above