在Eclipse中跑一个Spark的算Pi例子。报错如下:
ERRORSparkContext:ErrorinitializingSparkContext.org.apache.spark.SparkException:Amast...
ERROR SparkContext: Error initializing SparkContext.
org.apache.spark.SparkException: A master URL must be set in your configuration
at org.apache.spark.SparkContext.<init>(SparkContext.scala:394)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:61)
at org.apache.spark.examples.JavaSparkPi.main(JavaSparkPi.java:37)
15/10/28 22:01:15 INFO SparkContext: Successfully stopped SparkContext
Exception in thread "main" org.apache.spark.SparkException: A master URL must be set in your configuration
at org.apache.spark.SparkContext.<init>(SparkContext.scala:394)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:61)
at org.apache.spark.examples.JavaSparkPi.main(JavaSparkPi.java:37)
我注意到了A master URL must be set in your configuration。于是我加上了setMaster:
SparkConf sparkConf = new SparkConf().setAppName("JavaSparkPi").setMaster("spark://master:7077"):
加了setMaster("spark://master:7077")以后报错还是这,没有变。所以我想问这是什么情况?为什么会出现Error initializing SparkContext? 多谢指教! 展开
org.apache.spark.SparkException: A master URL must be set in your configuration
at org.apache.spark.SparkContext.<init>(SparkContext.scala:394)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:61)
at org.apache.spark.examples.JavaSparkPi.main(JavaSparkPi.java:37)
15/10/28 22:01:15 INFO SparkContext: Successfully stopped SparkContext
Exception in thread "main" org.apache.spark.SparkException: A master URL must be set in your configuration
at org.apache.spark.SparkContext.<init>(SparkContext.scala:394)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:61)
at org.apache.spark.examples.JavaSparkPi.main(JavaSparkPi.java:37)
我注意到了A master URL must be set in your configuration。于是我加上了setMaster:
SparkConf sparkConf = new SparkConf().setAppName("JavaSparkPi").setMaster("spark://master:7077"):
加了setMaster("spark://master:7077")以后报错还是这,没有变。所以我想问这是什么情况?为什么会出现Error initializing SparkContext? 多谢指教! 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏50(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询