Learn how to mount an EFS system from multiple instances and demonstrate their connected nature.
Now that our file system has been created, let's look at the details. Click the check-mark here and you'll see a lot more information. There's a link down here that says Amazon EC2 mount instructions. And that's exactly what we want to do next. You can see among all the information here that one thing we need to do is ensure that package nfs-utils is installed on our instance. I'm going to copy this command and head over to terminal. Now in this terminal, I have two tabs. In the white, I'm logged in to ebs demo 1 from earlier.
And in the blue, I'm logged into ebs demo 2, also from earlier. And you can see the difference not only in the background color, but in the IP that's referenced down here in the path. I'll paste in that yum install command to make sure that nfs-utils is installed. And not entirely surprisingly, it's already installed on Amazon Linux. Amazon keeps their AMI's up to date so we should expect things like this would already be there. Let's head back to the efs console. The next major section here shows us how to do a mount command.
Now we already know from a previous lesson how to mount a file system. However, there are a lot more parameters here than in our ebs example. If you click this link that says mounting considerations, you can see all the rationale and the pros and cons that go into the different parameters that aws is recommending here. For now, we're going to take the recommended options and just copy this command. But we will have to edit some things slightly. Let's head back to the terminal. Before I can execute the mount command, you will recall that I need a folder to be the mounting point. We'll do sudo main directory /efs.
Now we can paste in that mounting command that we have in the clipboard. But we need to make a slight modification here. There's a mistake. We just need to take out this space, and include another. There needs to be a space between the dns entry for the efs system, and a colon and your actual mounting point which is /efs. Now that I've got this command, we should be able to look at the disk free -h command and see our newly mounted efs file system. Now the -h command means human readable. So you can see the size here is 8.0E which actually stands for exabytes.
If we'd leave off -h, you can get a good idea of just how big this is. Hey look at that. That number is definitely much bigger than any other volume on this system. Now, what we want to do is go to the second ec2 instance from the previous lessons and do the exact same mount command. So, we'll take this over to the next tab and we'll create that mount point. And we'll head back and we'll copy the mount command. We're executing the exact same steps on another instance in the same availability zone.
So both of these instances will be talking to the same mount target object. If the second instance were in another AZ, we would have to go get the mount command for that particular availability zone. Now, if we look at the file system properties, it's just like when we first mounted an ebs volume. It's owned by root root. So you want to do sudu chown and we'll give it to ec2 user instead. Now if we look at the ls command again, you can see that the owner of the dot directory, which is the directory we're currently in, is ec2 user.
I'll head back to the other instance, and take a look at my mount point there. Now look at that. Here's how you know that we have a truly shared file system. Because I didn't have to change the ownership on this instance. Let's create a file. This is created by instance1, and this is created by instance2, and both are visible. So you can see the efs provides us true network storage on aws.
Join AWS architect Brandon Rich and learn how to configure object storage solutions and lifecycle management in Simple Storage Service (S3), a web service offered by AWS, and migrate, back up, and replicate relational data in RDS. Find out how to leverage flexible network storage with Elastic File System (EFS), and use the new AWS Glue service to move and transform data. Plus, learn how Snowball can help you transfer truckloads of data in and out of the cloud.
- What is data management?
- AWS S3 basics
- S3 bucket creation
- S3 upload and logging
- S3 event notifications
- S3 data lifecycle configuration
- Working with Amazon Elastic Block Store volumes
- Creating and mounting an EFS
- Creating an AWS RDS instance
- RDS backup and recovery
- Moving data with AWS Database Migration Service
- Moving data with Data Pipeline and Glue