Amazon EFS (Elastic File System) in AWS

Share via:

Dear Readers,

In this article,we will see Amazon EFS (Elastic File System) in AWS .

Steps to Follow
  1. Create EFS (Elastic File System).
  2. Launch 2 Linux Servers.
  3. Assign default security group to First Linux Server “Linux – 1”.
  4. Connect to first Linux Server “Linux – 1” terminal through putty.
  5. Provide default security group to Second Linux Server “Linux – 2”.
  6. Connect to Second Linux Server “Linux – 2” terminal through putty.
  7. Create Mount point for first Linux Server “Linux – 1”
  8. Make Mount Directory.
  9. Copy mount Command from EFS an Paste Mount command in Linux terminal.
  10. Make file in Mount Directory.
  11. Create Mount point for first Linux Server “Linux – 2”.
  12. Make Mount Directory.
  13. Copy mount Command from EFS an Paste Mount command in Linux terminal.
  14. Make file in Mount Directory and  Verify files in the mount directory.

Amazon EFS (Elastic File System) 

Amazon EFS provides scalable file storage for use with Amazon EC2.

You can create an EFS file system and configure your instances to mount the file system. You can use an EFS file system as a common data source for workloads and applications running on multiple instances.

Note

Amazon EFS is not supported on Windows instances.

  1. Create EFS (Elastic File System)

First, we need to AWS Console page by using below link.

https://aws.amazon.com/console/

Click on sign in to Console button.

Logging to aws account

Provide username and password then click on sign in.

Enter to AWS Management Console

We can see the AWS Management Console Dashboard.

Go to Services, Click on EFS in the Storage Module.

Click on Create file system.

Click on Next Step.

Specify the name for the EFS “My EFS”.

Click on Next Step.

Click on Create file system.

The Elastic file system “My EFS” has been created successfully.

The mount target state is creating now it will take some time to create.

 

Launch two Linux Servers

Go to Services, under the compute module click EC2 service to open.

Create and Configure a Virtual Machine

We can see EC2 Dashboard by default one security group is available and click on Launch Instance.

Choose an Amazon Machine Image (AMI)

Select the Operating system of the EC2 instance by choosing any of the Amazon Machine Images (AMI). Select the Microsoft Amazon Linux AMI.

Choose an Instance type

Choose the Type of instance depending on your requirements.

Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity so you can choose the appropriate mix for your applications.

select the default option of t2. micro – this instance type is covered within the free tier. Then click on Configure Instance Details.

Configure Instance Details

Configure EC2 instance details as per requirements of your environment.

Here we select 2 instances in the number of instances to create 2 instances at once.

Go Advanced Details and add some commands in user data.

Click on Add storage.

Add Storage

Add a new volume if two drives are required.

Add Tags

Tags assist in easier identification and classification of the various instances in your AWS environment.

Provide the name for the Linux virtual machine for easier understanding.

Configure Security Group

A security group allows configuring firewall rules to allow traffic as needed. Only one rule has been added to allow remote desktop connection.

SSH – Secure Shell

Review Instance Launch

Review and confirm the configuration of the instance. Click on the Edit button on each configuration item to make changes and click on Launch.

Create a Key Pair and Launch Your Instance

To connect to your virtual machine, you need a key pair. A key pair is used to log into your instance and select create a new key pair.

Create a new key pair and name it My Linux. Then click Download Key Pair.

After you have downloaded and saved your key pair, click Launch Instance to start your Windows Server instance.

My Linux.pem will be downloaded to your computer — make sure to save this key pair in a safe location on your computer.

click on view Instances to view the instance you have just created and see its status.

 

We can see  2 Linux virtual servers(EC2) which was created earlier.

Assign default security group to Linux Server “Linux – 1”

Select first Linux virtual server “My Linux – 1”

In the Actions choose networking and click on change security groups.

Select default security Group ID and click on Assign Security Groups.

Connect to First Linux Server “Linux – 1” terminal through putty

Provide default security group to Linux Server “Linux – 2”

Select first linux virtual server “My Linux – 2”

In the Actions choose networking and click on change security groups.

Select default security Group ID and click on Assign Security Groups.

Connect to Second Linux Server “Linux – 2” terminal through putty

Create Mount point for first Linux Server “Linux – 1”

Go to First Linux Server terminal

Switch to root user

Make Mount Directory

Make Directory “ktexperts”

Copy mount Command from EFS

Go to Services, Click on EFS in the Storage Module.

Click on Amazon EC2 mount instructions (from local VPC).

Copy command in the NFS Client.

Paste Mount command in Linux terminal 

Here,Replace efs with ktexpets for creating new mount point.

Note 

To run command in root user we shouldn’t type sudo and in the normal user you should mention sudo before the command.

Make file in Mount Directory

Go to Mount directory  ktexperts and make file

Create Mount point for first Linux Server “Linux – 2”

Go to Second Linux Server terminal

Switch to root user

Make Mount Directory

Make Directory “micronet”

Copy mount Command from EFS

Copy command in the NFS Client.

Paste Mount command in Linux Server terminal 

Here,Replace efs with ktexpets for creating new mount point.

Note

To run command in root user we shouldn’t type sudo and in the normal user you should mention sudo before the command.

Go to mount directory and check the files

Note 

Here, aws file came automatically because we created mount point for both servers.

whatever files create inside the mount directory it will be reflected to another server and  vice versa.

 

Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates

KTEXPERTS is always active on below social media platforms.

Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment