Nfs – Amazon Linux AMI for NFS between multiple EC2 servers

amazon ec2amazon-web-servicesnfs

So I've been trying to create a Dropbox like system to allow multiple EC2 instances to work with the same files. I'm writing the programs that actually modify the files myself, and I'm not worried about issues with concurrent modification errors, as I've designed my way around it. Now the closest I could find to do something like this was to use NFS which seems like a ray of sunshine from heaven. (And it didn't look that complex either!) Now, I ALMOST got it all set up, and then I ran headfirst int a brick wall. I've been following the following tutorial: http://hunterford.me/amazon-ec2-and-nfs/

The only thing I did differently was to replace this line:

/var/www/test   ec2-180-71-131-129.compute-1.amazonaws.com(rw,async)

with this line:

/home/ec2-user/Players *(rw,async)

The first part I changed because that's where I wanted to put my files that I wanted to share. The second part I changed because I couldn't figure out what I was supposed to put there, and he said I could put a wildcard. (I know all of you are cringing right now, I was too) I didn't get an error, so I went with it. Everything else went smoothly, and I did set up the security groups with all the ports listed opened.

When I went to mount the file on my other machine:

mount -t nfs {MY_FIRST_MACHINES_DNS_HERE}:/home/ec2-user/Players /home-ec2-user/Players

Now, first it sat there for a while just blinking at me. Eventually it timed out. Does anyone see what I did wrong? Frankly it could be anything because I have no idea what I'm doing when it comes to NFS. I've been using the standard (Free Tier) Amazon Linux AMI, with 16GB of the General Purpose SSD storage, on a t1.micro instance.

Best Answer

As of 2017 the easiest way to do this is AWS Elastic File System (EFS), which is NFS v4.1 compatible. You pay $0.30 to $0.36 per GB stored, with no pre-allocation of disk, so if you delete files you immediately pay less. It's not available in every region.

Latency is apparently higher than EBS, enough so that it can add measurable latency for some use cases, such as web hosting. Throughput is meant to be very good. I expect AWS are working on improvements. Performance testing is suggested to ensure it meets your needs.