Amazon EFS (Elastic File System)Storage

ACG LINK

Amazon 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

  1. File Storage:

    • Amazon EFS provides scalable file storage that can be mounted to multiple EC2 instances.
  2. Elastic Scaling:
    • Automatically scales storage capacity as files are added, and it can grow to petabytes in size.
  3. Compatibility:
    • Compatible with Linux-based EC2 instances, supporting NFS (Network File System) version 4.
  4. High Availability:
    • Data is stored redundantly across multiple Availability Zones within a region for high availability.
  5. 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.
  6. Lifecycle Management:
    • Supports data lifecycle management with the ability to create and manage automated backups.
  7. Access Control:
    • Supports standard POSIX permissions and Access Control Lists (ACLs) for fine-grained access control.
  8. 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:

  1. Login to AWS Console:

    • Navigate to the AWS Management Console.
  2. 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.
  3. 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.
  4. Configure Encryption (Optional):
    • Optionally, configure encryption for data at rest by enabling the "Encrypt" option.
  5. Create File System:
    • Review the configuration and click "Create file system."
  6. 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).
  7. 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
    
    
  8. 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.

  9. Verify the Mount (Linux):

    • Verify that the EFS file system is successfully mounted.
    bash
    df -h
    
    
  10. Use the EFS File System:
    • Store and access files on the mounted EFS file system as needed.
  11. 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.