How do I resolve "Failed to determine hostname of Instance" error using spark-ec2?

873 Views Asked by At

Trying to launch Spark cluster on EC2, getting error "Failed to determine hostname of Instance" (replaced sensitives with *):

$ spark-ec2 --vpc-id=vpc-* --subnet-id=subnet-* --slaves=1 --key-pair=* --identity-file=/Users/matthew/.ssh/* --instance-type=m3.large --master-instance-type=m3.large --region=us-east-1 --zone=us-east-1d --spark-version=2.0.2 --spark-ec2-git-branch=branch-2.0 launch spark-test
Setting up security groups...
Searching for existing cluster spark-test in region us-east-1...
Spark AMI: ami-35b1885c
Launching instances...
Launched 1 slave in us-east-1d, regid = r-0e02da15c115f6da2
Launched master in us-east-1d, regid = r-0d0f08c5f2a46a1df
Waiting for AWS to propagate instance metadata...
Applying tags to master nodes
Applying tags to slave nodes
Waiting for cluster to enter 'ssh-ready' state...........
Error:
 Failed to determine hostname of Instance:i-0909d1ed1af09cd09.
Please check that you provided --private-ips if necessary

I can't ssh into the master because there is no public ipv4. My AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY env vars are configured correctly, and my account has full permissions, AFAIK. How do I resolve this error?

EDIT 1: FYI, entered issue https://github.com/amplab/spark-ec2/issues/90

1

There are 1 best solutions below

1
On

I've had this problem when I've launched into a private subnet (a subnet with no internet gateway). One solution is to make sure it's a public subnet. "Auto-assign public IPs" must also be enabled in the subnet.

If you want a private subnet, you can try using the --private-ips flag, though I've not tried that.