Thursday, March 23, 2023

steps to create an AWS EFS volume and mounting the EFS volume to two instances.

 Here are the steps to create an AWS EFS volume and mount it to two instances:

  1. Log in to your AWS console and navigate to the EFS service.

  2. Click on the "Create file system" button.

  3. Select the appropriate VPC and subnet for your EFS volume.

  4. Choose a performance mode for your EFS volume. You can select either "general purpose" or "max I/O."

  5. Set the throughput mode for your EFS volume. You can select either "bursting" or "provisioned."

  6. Set the encryption for your EFS volume. You can choose to encrypt your data at rest or not.

  7. Configure the network settings for your EFS volume. You can choose to allow access from specific IP addresses or allow access from anywhere.

  8. Click on the "Create file system" button to create your EFS volume.

  9. After the EFS volume is created, navigate to the "Access Points" tab and click on the "Create Access Point" button.

  10. Set the name and permissions for your access point.

  11. Click on the "Create Access Point" button to create your access point.

  12. Navigate to the EC2 service and launch two instances in the same VPC and subnet as your EFS volume.

  13. SSH into each instance and run the following command to install the EFS mount helper:

sudo yum install -y amazon-efs-utils
  1. Create a mount point directory on each instance. For example, you can use the following command:
bash
sudo mkdir /mnt/efs
  1. Mount the EFS volume to each instance using the following command:
javascript
sudo mount -t efs -o tls fs-xxxxxxxx:/ /mnt/efs

Note: replace fs-xxxxxxxx with the file system ID of your EFS volume.

  1. Verify that the EFS volume is mounted on each instance by running the following command:
bash
df -h

You should see the EFS volume listed as a mounted filesystem.

Now, you have successfully created an AWS EFS volume and mounted it to two instances.

The EFS volume can be accessed from both instances, and any changes made on one instance will be visible on the other instance as well.

No comments: