Exception: could not open socket on pyspark

前端 未结 3 2101
北恋
北恋 2020-12-19 16:42

Whenever I am trying to execute a simple processing in pyspark, it fails to open the socket.

>>> myRDD = sc.parallelize(range(6), 3)
>>> sc         


        
3条回答
  •  抹茶落季
    2020-12-19 17:19

    I was having the exact same error, tried JDK 1.7 and it didn't work, then i went and edited the /etc/hosts file and realized i had the following lines

    127.0.0.1 mbp.local localhost
    127.0.0.1 localhost
    

    Just commented out the line with my computer local name and it worked.

    #127.0.0.1 mbp.local localhost
    127.0.0.1 localhost
    

    Tested on PySpark 1.6.3 and 2.0.2 with JDK 1.8

提交回复
热议问题