Getting Familiar With Amazon Elastic File System

Posted By : Avinash Singh | 22-Nov-2021

AWS

Loading...

Introduction

Amazon Elastic File System (Amazon EFS) is a network file system (NFS ) that provides a simple, secure, scalable, fully managed storage solution to use, with AWS Cloud services and on-premises resources.

Features

  • Petabyte scale, Auto scaling shared file storage
  • POSIX compliant
  • Supports NFS v4.0 and v4.1 protocols
  • Pay as per use (no upfront charges)
  • High availability and durability across multiple Availability Zone in a region
  • Compatible with Amazon EC2 Linux-based instances
  • Share with thousands of Amazon EC2 instances
  • Use Max I/O Mode for higher throughput (with a small increase in latency for all file operations)

Start To Work With AWS EFS Service

Step 1. From AWS Management Console, Go to Storage => EFS => Create File System => Customize

Step 2:- Configure File system settings

Step 3 :- Configure network access settings

Step 4 :- Setting Up File System Policy

Step 5 :- Overview of created EFS

Step 6:- Launch AWS EC2 servers, Allow NFS Protocol in AWS Security Group, Login to AWS EC2 Servers, and Install EFS support packages and dependencies

# " amazon2 linux"

# sudo yum install -y amazon-efs-utils

# "rhel/centos "

# sudo yum install -y nfs-utils

# ubuntu/debian

# sudo apt-get install nfs-common

Step 7:- On machine 1, login as root, create a directory, and mount efs with that directory

$ sudo su

$ mkdir /nfs-dir

# connecting with method 1 , Using the EFS mount helper:

$ mount -t efs -o tls fs-044c15e8b34e19e9b:/ /nfs-dir

# create a file to share

$ echo "hello world" > /nfs-dir/first-file.txt

Step 8:- Login to second ec2 machine, and install nfs packages, and follow same steps

$ sudo su

$ mkdir /my-efs

# connecting with method 2 , Using the NFS client:

$ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-044c15e8b34e19e9b.efs.ap-south-1.amazonaws.com:/ /my-efs

$ ls /my-efs

$ cat /my-efs/first-file.txt

To unmount nfs from any machine, unmounting will de-attach efs from mount point, leaving folder as blank, keeping files/folder in efs as it is .

umount /my-efs

Our setup is done, and both machines are connected with each other and can share file between them


We are a seasoned ERP development company that provides complete enterprise software solutions to address cross-industry business requirements. Our end-to-end ERP development services enable enterprises to streamline their complex business operations and achieve higher levels of productivity. To learn more about our custom ERP development services, reach out at [email protected].