首页 > 代码库 > A master URL must be set in your configuration问题解决方法
A master URL must be set in your configuration问题解决方法
1 Using Spark‘s default log4j profile: org/apache/spark/log4j-defaults.properties 2 16/10/21 18:13:00 INFO SparkContext: Running Spark version 2.0.0 3 16/10/21 18:13:02 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 4 16/10/21 18:13:04 ERROR SparkContext: Error initializing SparkContext. 5 org.apache.spark.SparkException: A master URL must be set in your configuration 6 at org.apache.spark.SparkContext.<init>(SparkContext.scala:371) 7 at SummaryStatisticsExample$.main(SummaryStatisticsExample.scala:17) 8 at SummaryStatisticsExample.main(SummaryStatisticsExample.scala) 9 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 10 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 11 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 12 at java.lang.reflect.Method.invoke(Method.java:606) 13 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) 14 16/10/21 18:13:04 INFO SparkContext: Successfully stopped SparkContext 15 Exception in thread "main" org.apache.spark.SparkException: A master URL must be set in your configuration 16 at org.apache.spark.SparkContext.<init>(SparkContext.scala:371) 17 at SummaryStatisticsExample$.main(SummaryStatisticsExample.scala:17) 18 at SummaryStatisticsExample.main(SummaryStatisticsExample.scala) 19 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 20 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 21 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 22 at java.lang.reflect.Method.invoke(Method.java:606) 23 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) 24 25 26 Process finished with exit code 1
在第5行位置提示:A master URL must be set in your configuration
解决方法:
Run->Edit Configurations->Configuration界面下,将VM-optionsz设置为“-Dspark.master=local”
A master URL must be set in your configuration问题解决方法
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。