Mac spark-shell Error initializing SparkContext

前端 未结 12 1028
礼貌的吻别
礼貌的吻别 2020-12-07 09:26

I tried to start spark 1.6.0 (spark-1.6.0-bin-hadoop2.4) on Mac OS Yosemite 10.10.5 using

\"./bin/spark-shell\". 

It has the error below.

12条回答
  •  独厮守ぢ
    2020-12-07 09:46

    If you are using Scala to run the code in an IDE, and if you face the same issue and you are not using SparkConf() as pointed out above and using SparkSession() then you could bind the localhost address as follows as set only works in SparkConf(). You should use .config() to set the spark configuration as shown below:

        val spark = SparkSession
           .builder()
           .appName("CSE512-Phase1")
           .master("local[*]").config("spark.driver.bindAddress", "localhost")
           .getOrCreate()
    

提交回复
热议问题