A master URL must be set in your configuration问题解决方法

Posted ccLiuo-o

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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问题解决方法的主要内容,如果未能解决你的问题,请参考以下文章

“Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets

ValueError: For multi-metric scoring, the parameter refit must be set to a scorer key or a callable(

ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form

TypeError: view must be a callable or a list/tuple in the case of include()

The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF(示

mysql报错:You must at least set –server-id to enable either a master or a slave