Sunday 16 August 2020

EFS IN AWS

What is EFS?
Amazon Elastic File System (Amazon EFS) is a file storage service for Amazon Elastic Compute Cloud (Amazon EC2) instances. Amazon EFS is easy to use and provides a simple interface that allows you to create and configure file systems quickly and easily. with Amazon EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files, so your applications have the storage they need, when they need it.


Why EFS?

  • One EFS can share to two EC2 instances, where as with EBS sharing with two EC2 instance is not possible.
  • Even TB of disk storage can grow automatically.

Practical steps:

Step 1: Creating EFS volume.
  • Log in to AWS console.
  • Navigate to Services -->Under Storage section -->EFS.

  • Click on Create file system in the below screen.

  • Then below screen will appears with availability zone information.Click on Next step.
  • Add tags - generally used for better description of system in AWS console.


  • Enable life cycle management if really required.Otherwise go with None option.                                                                              



Below are the list of time frequency available, Suppose if the file is not accessed in last 14 days, then the file automatically moves to cheaper storage place.
  • Read the description of throughput mode. and select the required option. Here i am okay with Bursting.
  • Read the description of performance mode. and select the required option. Here i am okay with General purpose.
  • Enable encryption if needed --> select KMS master key.
  • Click on Next step as highlighted below.


  • Review all the inputs, so far provided.Click on Create file system.                                                                                                                            

  • Then the successfully EFS creation screen will appear as below.



Step 2:   Mandatory step: Once after creating EFS drive. enabling  the NFS port is mandatory step.    from the running EC2 instance screen(services -->compute -->EC2-->Running EC2 instance). Navigate to security groups.



Navigate to inbound -->edit.

Here in my case NFS port is opened by default.If in case it is closed.Click on Add role --> in the type column provide NFS as input.Rest all columns information will update automatically.


Step 3: Mount EFS volume to EC2 instance.                                                                                                  Navigate to services --> storage -->EFS (as shown in step 1).Click on Amazon EC2 mount instructions(from local VPC) available in File system access section.      


Execute the below series of commands in both( here i am testing for 2 systems) systems.

based on the directory you provided in the commands. EFS will be configured the file sync will also happens automatically in both the systems.




Few important points:

Supports the Network File System version 4 (NFSv4) protocol.
you only pay for the storage you use(no pre- provisioning required.)
can scale up to the petabytes
can support thousands of concurrent NFS connections
Data is stored across multiple AZ's within a region.
Read After write consistency.

No comments:

Post a Comment