Successfully implemented file sharing between two EC2 instances using Amazon EFS
Recently, I explored how to set up Amazon EFS (Elastic File System) between two EC2 instances located in different availability zones (us-east-1a and us-east-1b). Here’s how I made it happen:
Steps I Followed
1️⃣ Created an EFS and Two EC2 Instances
2️⃣ Configured Security Groups
3️⃣ Installed EFS UtilitiesExecuted the following command on both servers:
yum install -y amazon-efs-utils
4️⃣ Mounted EFS on Both Servers
On server1:
On server2:
5️⃣ Tested File Sharing
cd /efs-server1/
touch file01 file02
ls
Verified file sharing by adding content to file01 from server2:
cd /efs-server2/
cat > file01
Hello, this is from efs-server2!
Checked that the changes reflected in server1:
cat file01
Hello, this is from efs-server2!
Advantages of Using EFS Across EC2 Instances
1️⃣ Scalability: Automatically grows and shrinks as you add or remove data.
2️⃣ Shared Access: Enables multiple EC2 instances to access the same file system.
3️⃣ High Availability: Works seamlessly across multiple availability zones.
4️⃣ Simple Management: No need for manual provisioning or managing storage.
5️⃣ Cost-Effective: Pay for what you use without upfront costs.
Aspiring AWS and DevOps Engineer| CI/CD | Cloud Infrastructure | Automation Enthusiast
5moVery informative