amazon-web-servicesamazon-ec2pysparkunknown-host

ec2, pyspark: java.net.UnknownHostException Name or service not known


I have set up the pyspark environment on AWS ec2 instance following this tutorial

However, when I simply test

sc = SparkContext.getOrCreate()

it keeps giving the error as follow:

error msg

I use 54.255.207.212 to connect my ec2, and after log in, the ip-address for this ec2 is 172.30.0.112.

Is there anything wrong about the configuration or the hostname? Thanks a lot in advance!


Solution

  • Under your security group configuration, allow all inbound traffic to the instance.

    enter image description here