How to Implement AWS EFS to Share File System between EC2?

If you’re working in a multi-server utility surroundings the place it’s essential share a file system between a number of servers, then it’s essential arrange NFS (Community File System).

NFS permits you share the file system on multiple serverhowever implementation requires some administrative expertise.

In a standard infrastructure surroundings, chances are you’ll must contain a number of groups, and it takes time to create NFS. However in the event you use AWS, you are able to do it in minutes with their EFS (Elastic File System) service.

youtube video

AWS EFS allows you to create scalable file storage for use on EC2. You do not have to fret about capability forecasting scale up or down on demand.

A brief illustration has been pulled from the AWS web page to offer you an concept of ​​the way it works.

aws-efs-1

A number of the advantages of EFS are:

  • Absolutely managed by AWS.
  • Low price, pay for what you utilize.
  • Extremely accessible and sustainable
  • Mechanically scale up or down.
  • Scalable efficiency

I’ve two EC2 Ubuntu situations working and on this tutorial I shall be creating one EFS after which mount it on each EC2 servers.

Let’s begin.

  • Log in to the AWS console
  • Go to Providers and choose EFS underneath storage (direct hyperlink)
  • Click on on ‘Create File System’.
efs splash
  • AWS mechanically assigns an IP tackle within the Availability Zone. If you wish to change this, you are able to do so on the subsequent display.
aws-efs-config-e1502700135557
  • If needed, add the tag and choose the efficiency mode between Generic or Max I/O
aws-efs-type
  • Test the configuration and if all the things is OK, click on on “Create file system.”

It could take a couple of seconds, and whenever you’re executed, you may get successful message.

Good luck!

You’ve got created a file system. You possibly can mount your file system from an EC2 occasion with an NFSv4.1 shopper put in. It’s also possible to mount your file system from a neighborhood server by way of an AWS Direct Join connection.

It is possible for you to to see the newly created elastic file system within the checklist.

efs list

This concludes that you’ve got created EFS and are able to be related to EC2 situations.

Mount EFS on EC2

Earlier than you possibly can mount, you could set up the NFS shopper. Increasing the checklist and clicking on “Amazon EC2 Meeting Directions” offers you the small print.

aws-efs-details

However let’s have a look at the way it goes.

  • Log in to each EC2 situations and set up the NFS shopper. I’ve Ubuntu so I’ll use the next.
apt-get set up nfs-common
  • Let’s create a folder the place you need to mount the EFS.

For instance: /apps

cd / 
mkdir apps

Mount the file system with the command from the directions.

Ex:

mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,exhausting,timeo=600,retrans=2 fs-4fd14a06.efs.us-east-1.amazonaws.com:/ apps

Comment: For those who run into points whereas pairing, take a look at this troubleshooting information and do not forget to verify the safety teams to make sure the next.

  • NFS port (2049) is allowed within the inbound guidelines of EC2 situations
  • EC2 safety teams are allowed in EFS safety teams

It’ll take a couple of seconds and you’ll discover that /apps is mounted whenever you do this df -h command

root@ip-172-31-6-238:/# df -h | grep apps 
fs-4fd14a06.efs.us-east-1.amazonaws.com:/  8.0E     0  8.0E   0% /apps 
root@ip-172-31-6-238:/#

Now it’s essential login to a different server the place you need /apps accessible and repeat making a folder and mounting the EFS.

To confirm, I mounted my EFS on one other server and see that /apps is accessible on each servers.

root@ip-172-31-12-97:/apps# df -h | grep apps 
fs-4fd14a06.efs.us-east-1.amazonaws.com:/  8.0E     0  8.0E   0% 
/apps root@ip-172-31-12-97:/apps#

That is straightforward, is not it?

I’ve tried creating a couple of information, and general efficiency seems to be good. AWS EFS seems to be promising, and in the event you want filesystem sharing between EC2 situations, give it a strive, and I am certain you may prefer it.

Wish to know extra about AWS? Try this Udemy course.

Leave a Comment

porno izle altyazılı porno porno