1

I'm trying to create 3 node AWS EMR cluster. I have also create a key to connect to cluster from macOS with command :

ssh -i ~/Downloads/BigdataKey.pem hadoop@ec2-xx-xx-xx-xx.ap-south-1.compute.amazonaws.com

But its giving error :

192:Downloads nageshsinghchauhan$ ssh -i ~/Downloads/BigdataKey.pem hadoop@ec2-xx-xx-xx-xx.ap-south-1.compute.amazonaws.com
ssh: connect to host ec2-xx-xx-xx-xx.ap-south-1.compute.amazonaws.com port 22: Operation timed out

Any one please help me out, I'm trying this for the first time using macOS.

1 Answers1

2

The solution I found is that:

  1. Go to EC2 security groups and and open "ElasticMapReduce-master".
  2. Under Inbound tab, click edit.
  3. Add rule, and provide Type = All TCP, port range = 0-65535, source = MyIP.
  4. now go to terminal and provide permission as :chmod 400 my-key-pair.pem
  5. Last step, try SSH to your cluster via your key from mac.

It's Done :)

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 1
    It is strongly recommended to only allow access on port 22 for SSH. There is no need to open any other ports. If you want to access web UIs, use an SSH tunnel to redirect traffic: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-ssh-tunnel-local.html Keep in mind that your IP address might change, depending on whether your ISP provides static or dynamic IP addresses. You might need to update that Security Group rule every few days. – Tyrone321 Dec 25 '18 at 11:14
  • Thank you so much @Tyrone321 this is really helpful, All my data got lost from HDFS and linux. I guess this is because I'm specifying port range as 0-65535 ? – Nagesh Singh Chauhan Dec 26 '18 at 04:32
  • 1
    It is possible that someone might have gained unauthorized access to your EMR cluster, and deleted that data. I suggest checking whether you lost data due to losing core nodes though. See what the output of `$ hdfs dfsadmin -report` shows. Store your data on S3, rather than HDFS. Much better availability and redundancy, and you can access it from more places (i.e. Athena for queries, other EMR clusters, local computer etc). – Tyrone321 Dec 26 '18 at 10:10
  • The steps work!! IPv6 does not work so I googled and copied the Public IPv4 from whatismyip.com and it worked :) – Jugal Panchal Jun 15 '22 at 20:17