ajesh kumar
ajesh kumar

Reputation: 96

error while executing the example spark streaming code JavaNetworkWordCount.java in eclipse

Exception in thread "main" org.apache.spark.SparkException: A master URL must be set in your configuration

at org.apache.spark.SparkContext.(SparkContext.scala:185)
at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:571)
at org.apache.spark.streaming.StreamingContext.(StreamingContext.scala:74)
at org.apache.spark.streaming.api.java.JavaStreamingContext.(JavaStreamingContext.scala:130)

Upvotes: 0

Views: 1207

Answers (1)

ajesh kumar
ajesh kumar

Reputation: 96

We need to set master with thread >1 while creating the sparkconf.

SparkConf sparkConf = new SparkConf()
  .setAppName("JavaNetworkWordCount").setMaster("local[2]");

Upvotes: 1

Related Questions