9 Sharing data volumes between machines: EFS

 

This chapter covers

  • Creating a highly available network filesystem
  • Mounting a network filesystem on multiple EC2 instances
  • Sharing files between EC2 instances
  • Tweaking the performance of your network filesystem
  • Monitoring possible bottlenecks in your network filesystem
  • Backing up your shared filesystem

Many legacy applications store state in a filesystem on disk. Therefore, using Amazon S3—an object store, described in chapter 7—isn’t possible without modifying the application. Using block storage as discussed in the previous chapter might be an option, but it doesn’t allow you to access files from multiple machines. Because block storage persists data in a single data center only, AWS promises an uptime of only 99.9%.

If you need to share a filesystem between virtual machines or require high availability, the Elastic File System (EFS) might be an option. EFS is based on the NFSv4.1 protocol, which allows you to mount and access the filesystem on one or multiple machines in parallel. EFS distributes data among multiple data centers, called availability zones, and promises an uptime of 99.99%. In this chapter, you learn how to set up EFS, tweak the performance, and back up your data.

EFS works only with Linux

At this time, EFS isn’t supported by Windows EC2 instances. The Amazon FSx for Windows File Server is an alternative to EFS for Windows workloads. See http://mng.bz/zmq1 to learn more.

9.1 Creating a filesystem

9.1.1 Using CloudFormation to describe a filesystem

9.1.2 Pricing

9.2 Creating a mount target

9.3 Mounting the EFS filesystem on EC2 instances

9.4 Sharing files between EC2 instances

9.5 Tweaking performance

9.5.1 Performance mode

9.5.2 Throughput mode

9.5.3 Storage class affects performance