Amazon EFS (Elastic File System)Storage
ACG LINKAmazon EFS (Elastic File System): Overview and Configuration Example
Amazon Elastic File System (Amazon EFS) is a scalable and fully managed file storage service that can be easily mounted on multiple Amazon EC2 instances. It provides a simple, scalable, and highly available file system for use with both Linux and Windows instances. Here's a detailed overview of Amazon EFS along with a configuration example:
Features of Amazon EFS
-
File Storage:
- Amazon EFS provides scalable file storage that can be mounted to multiple EC2 instances.
- Elastic Scaling:
- Automatically scales storage capacity as files are added, and it can grow to petabytes in size.
- Compatibility:
- Compatible with Linux-based EC2 instances, supporting NFS (Network File System) version 4.
- High Availability:
- Data is stored redundantly across multiple Availability Zones within a region for high availability.
- Performance Modes:
- Offers two performance modes: General Purpose (default) and Max I/O.
- General Purpose mode is suitable for most workloads, while Max I/O is designed for high-performance, low-latency applications.
- Lifecycle Management:
- Supports data lifecycle management with the ability to create and manage automated backups.
- Access Control:
- Supports standard POSIX permissions and Access Control Lists (ACLs) for fine-grained access control.
- Mount Targets:
- Multiple mount targets can be created in different subnets, allowing EC2 instances in different subnets to access the same EFS file system.
Configuration Example
Let's create a simple Amazon EFS file system and mount it to an Amazon EC2 instance using the AWS Management Console:
-
Login to AWS Console:
- Navigate to the AWS Management Console.
- Create an Amazon EFS File System:
- Click on the "EFS" service.
- Click "Create file system" and configure the file system settings, such as the performance mode and throughput mode.
- Configure File System Access:
- Set up the VPC and security group settings for the EFS file system.
- Create one or more mount targets in different subnets.
- Configure Encryption (Optional):
- Optionally, configure encryption for data at rest by enabling the "Encrypt" option.
- Create File System:
- Review the configuration and click "Create file system."
- Mount the EFS File System on EC2 Instance:
- Launch or select an existing EC2 instance.
- Connect to the instance using SSH (for Linux) or RDP (for Windows).
- Install NFS Client (Linux):
- On a Linux instance, install the NFS client if not already installed.
bash sudo apt-get update sudo apt-get install nfs-common
- Mount the EFS File System (Linux):
- Create a directory on the EC2 instance and mount the EFS file system.
bash sudo mkdir /mnt/myefs sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 <EFS-DNS-Name>:/ /mnt/myefs
Replace <EFS-DNS-Name> with the DNS name of your EFS file system.
-
Verify the Mount (Linux):
- Verify that the EFS file system is successfully mounted.
bash df -h
- Use the EFS File System:
- Store and access files on the mounted EFS file system as needed.
- Unmount and Cleanup (Optional):
- When finished, unmount the EFS file system using sudo umount /mnt/myefs (Linux).
- Optionally, you can delete the EFS file system and associated resources through the AWS Management Console.