简体   繁体   中英

AWS EMR connect to Master Node: Connection Refused

I have setup a new EMR instance on AWS. I've copied the ssh connection command for the master node.

ssh -i -vvv ~/.ssh/xxxx.pem hadoop@ec2-xx-xxx-xxx-xx.us-east-2.compute.amazonaws.com

I have the pem file in the correct location. I have changed permissions on the file with

chmod 400 ~/.ssh/xxxx.pem 

I still get the following error:

debug1: Connecting to ec2-18-219-186-80.us-east-2.compute.amazonaws.com port 22.

Any help much appreciated.

I figured it out. You have to add SSH permission to the security group on the machine you wish to SSH to. Go to EC2, then down to security groups, and on the master node, and add rule for SSH.

From Amazon:

Security groups are restrictive by default. They reject all traffic. You can add a rule to allow traffic on a particular port to your custom or additional security groups. If there is more than one rule for a specific port in two security groups that apply to the same instances, the most permissive rule is applied. For example, if you have a rule that allows SSH access via TCP port 22 from IP address 203.0.113.1 and another rule that allows access to TCP port 22 from any IP address (0.0.0.0/0), the rule allowing access by any IP address takes precedence.

https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-additional-sec-groups.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM