First time using EFS--missing something-detailed steps shown

0

Hello, I did these steps:
##2) Spin up 2 Linux instances
#Login console
#Launch, Select Amazon Linux 2 AMI,
#select t2,micro
#Number of instances 2
#Accept VPC default
#Configure new Security Group with rules opening (SSH, NFS, all TCP)
#Launch, download pemFile
#chmod 400 pemFile
ssh -i pemFile ec2-user@IPv4PublicIP
sudo yum update
##3) Set up password-less SSH between the two instances
ssh-keygen -N ""
copy ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys of lead and slave nodes
#Note: ssh-copy-id $dest does not work as on Debian for previous step

My two instances are:
ec2-18-223-136-147.us-east-2.compute.amazonaws.com
ip-172-31-44-117.us-east-2.compute.internal
vpc-b5b91ade
subnet-4e066e02

and
ec2-18-218-243-42.us-east-2.compute.amazonaws.com
ip-172-31-44-239.us-east-2.compute.internal
vpc-b5b91ade
subnet-4e066e02

#Note: Package 1:nfs-utils-1.3.0-0.54.amzn2.0.2.x86_64 already installed and latest version
sudo yum install -y amazon-efs-utils

I can see maybe a problem here because when I setup EFS with Network, I only see:
us-east-1a,b,c,d,e, no us-east-2 entries
and vpc-74b84809
Availability zone us-east-1a
Then, the Attach page gives me:
[ec2-user@ip-172-31-29-158 ~]$ sudo mount -t efs -o tls fs-03a16a81:/ efs
Failed to resolve "fs-03a16a81.efs.us-east-2.amazonaws.com" - check that your file system ID is correct.
See https://docs.aws.amazon.com/console/efs/mount-dns-name for more detail.
[ec2-user@ip-172-31-29-158 ~]$ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-03a16a81.efs.us-east-1.amazonaws.com:/ efs
mount.nfs4: Failed to resolve server fs-03a16a81.efs.us-east-1.amazonaws.com: Name or service not known
mount.nfs4: Operation already in progress
[ec2-user@ip-172-31-29-158 ~]$ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 172.31.45.108:/ efs
mount.nfs4: Connection timed out
[ec2-user@ip-172-31-29-158 ~]$

What am I missing or doing wrong?
Thanks!

Edited by: oschreiber on Aug 18, 2020 1:16 PM

asked 4 years ago1227 views
3 Answers
0

Sounds like your EFS is in a different region than your EC2 instances...which would make for a more difficult connection from your EC2 instances.

I would create the EFS in the same region as EC2. Then make sure that security group access between the EFS security group and the EC2 security group there (usually that part is my problem area when I can not mount).

Some details here on security groups...

https://docs.aws.amazon.com/efs/latest/ug/network-access.html

answered 4 years ago
0

Thanks, I did find eventually the way to get the same region for EFS as instance.
So now I am studying your suggestions on security group.
Thanks!

answered 4 years ago
0

Thank you so very much. That page was evoking how to set the security groups of instances and EFS and another page showed how to edit that into the VPC's.
Not evident to me but I am glad EFS mounted on the two nodes, now.
Thanks!

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions