Cloudibn News

Be updated with Technology

  • BIG Data & Analytics
  • CLOUD
  • Data Center
  • IOT
  • Machine Learning & AI
  • SECURITY
  • Blockchain
  • Virtualization
You are here: Home / CLOUD / Sharing data volumes between machines: EFS

Sharing data volumes between machines: EFS

April 26, 2018 by cbn Leave a Comment

Many legacy applications store state in files on disk. Therefore, using Amazon S3, an object store, is impossible by default. Using block storage might be an option, but it won’t allow access to files from multiple machines in parallel. Hence you need a way to share the files between virtual machines. With Elastic File System (EFS), you can share data between multiple EC2 instances and your data is replicated between multiple Availability Zones (AZ). EFS is based on the NFSv4.1 protocol, which allows you to mount it like any other file system. In this article you’ll learn about the basics of EFS.

Note: EFS only works with Linux. At this time, EFS isn’t supported by Windows EC2 instances.

Let’s have a closer look at how EFS works compared to Elastic Block Store (EBS) and Instance Store. An EBS volume is tied to a data center, also called Availability Zone (AZ), and can only be attached over the network to a single EC2 Instance from the same data center. Usually EBS volume are used as the root volumes, which contain the operating system, or for relational database systems to store the state. An Instance Store consists of a hard drive directly attached to the hardware which the virtual machine is running on. Instance Store can be regarded ephemeral storage and is used for caching or for NoSQL database with embedded data replication only. In contrast, the EFS file system can be used by multiple EC2 instances from different data centers in parallel. Additionally, the data of the EFS file system is replicated among multiple data centers and remains available even if a whole data center suffers from an outage, which isn’t true for EBS and Instance Store. The following figure shows the differences.

Comparing EBS, Instance Store, and EFS File System

Now that you know about the differences, it’s time to have a closer look at EFS. Two main components require your attention:

  1. EFS File System: Stores your data
  2. EFS Mount Target: Makes your data accessible

This article, excerpted from chapter 10 of Amazon Web Services in Action, Second Edition.

Amazon Web Services in Action, Second Edition

Save 37% off Amazon Web Services in Action, Second Edition with code fccwittig at manning.com.

The EFS File System is the resource that stores your data in an AWS region. But you can’t access the file system directly. To access your file system, you must create an EFS Mount Target in a subnet. The mount target provides a network endpoint that you can use to mount the file system via NFSv4.1. With the mount target endpoint, you can finally mount the EFS File System on an EC2 Instance. The EC2 Instance must be in the same subnet as the EFS Mount Target, but you can create mount targets in multiple subnets. The following figure demonstrates how to access an EFS File System from EC2 instances running in multiple subnets.

ount targets provide an endpoint for EC2 instances to mount the file system in a subnet

Equipped with the EFS theory about file systems and mount targets, you can now apply your knowledge to solve a real problem. The Linux operating system is a multiuser system. Many users can store data and run programs isolated from each other. Each Linux user can have a home directory which is usually stored under /home/$username. If the user name is michael, the home directory would be /home/michael. And only the michael user would be allowed to read and write in /home/michael. The ls -d -l /home/* command list all home directories.

$ ls -d -l /home/* (1)
drwx------ 2 andreas andreas 4096 Jul 24 06:25 /home/andreas (2)
drwx------ 3 michael michael 4096 Jul 24 06:38 /home/michael (3)

(1) List all home directories with absolute paths
(2) /home/andreas can only be accessed by the user and group andreas
(3) /home/michael can only be accessed by the user and group michael

If you’re using multiple EC2 instances, your users will have a separate home folder on each EC2 instance. If a Linux user uploads a file on one EC2 instance, she can’t access the file on another EC2 instance. To solve this problem, you’ll create an EFS File System and mount the EFS File System on each EC2 Instance under `/home. The home directories are then shared across all your EC2 instances and users feel at home when they login no matter on which virtual machine.

That’s all for this article. If you want to know more, check out the 10th chapter of Amazon Web Services in Action, Second Edition and see this slide deck.

Share on FacebookShare on TwitterShare on LinkedinShare on Pinterest

Filed Under: CLOUD

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015

Recent Posts

  • T-Mobile’s 5G Advanced Network Solutions Bring Compute to the Edge with Dell Technologies
  • Thoughtworks weighs in on multicloud
  • Sunshine Makes Us Happy
  • Secure Software Supply Chain: Why Every Link Matters
  • VAST Data Answers the Customer Call For More Speed, Scale and Security With Newest Feature Releases

Recent Comments

    Categories

    • Artificial intelligence
    • BIG Data & Analytics
    • BlockChain
    • CLOUD
    • Data Center
    • IOT
    • Machine Learning
    • SECURITY
    • Storage
    • Uncategorized
    • Virtualization

    Categories

    • Artificial intelligence (153)
    • BIG Data & Analytics (192)
    • BlockChain (523)
    • CLOUD (2,270)
    • Data Center (751)
    • IOT (2,940)
    • Machine Learning (249)
    • SECURITY (895)
    • Storage (29)
    • Uncategorized (69)
    • Virtualization (1,538)

    Subscribe Our Newsletter

    0% Complete

    Copyright © 2022 · News Pro Theme on Genesis Framework · WordPress · Log in

    Looking for Cloud Solutions, We can help !

    ×