Chapter 10. Sharing data volumes between machines: EFS

 

This chapter covers

  • Creating a highly available shared filesystem
  • Mounting your shared filesystem on multiple EC2 instances
  • Sharing files between EC2 instances
  • Testing performance of your shared filesystem
  • Backing up your shared filesystem

Many legacy applications store state in files on disk. Therefore, using Amazon S3, an object store, as described in chapter 8 is not possible by default. Using block storage as discussed in the previous chapter might be an option, but does not allow you to access 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, so you can mount it like any other filesystem. In this chapter you learn how to set up EFS, tweak performance, and back your data.

EFS only works with Linux

At this time, EFS is not supported by Windows EC2 instances.

Examples are 100% covered by the Free Tier

The examples in this chapter are completely covered by the Free Tier. As long as you don’t run the examples longer than a few days, you won’t pay anything. Keep in mind that this only applies if you created a fresh AWS account for this book and nothing else is going on in your AWS account. Try to complete the chapter within a few days; you’ll clean up your account at the end.

10.1. Creating a filesystem

10.2. Creating a mount target

10.3. Mounting the EFS share on EC2 instances

10.4. Sharing files between EC2 instances

10.5. Tweaking performance

10.6. Monitoring a filesystem

10.7. Backing up your data

Summary