簡體   English   中英

Spark Scala應用程序未使用SBT在Eclipse中運行

[英]Spark Scala app not running in eclipse using sbt

我,我已經按照下面的鏈接使用sbt eclpise插件在Eclipse中創建了spark scala應用程序。

https://www.nodalpoint.com/development-and-deployment-of-spark-applications-with-scala-eclipse-and-sbt-part-1-installation-configuration/

完成所有步驟,並能夠使用sbt運行SampleApp。 但是,當我將應用程序移植到日食時,我無法像這樣運行應用程序。 但是可以使用Scala解釋器逐行運行。 以下是運行應用程序時遇到的錯誤。 有什么問題的主意嗎?

Using Spark's default log4j profile: org/apache/spark/log4j-
defaults.properties
17/09/12 22:27:55 INFO SparkContext: Running Spark version 1.6.0
17/09/12 22:27:56 WARN NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
17/09/12 22:27:56 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:401)
at TowerLocator$.main(TowerLocator.scala:11)
at TowerLocator.main(TowerLocator.scala)
17/09/12 22:27:56 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:401)
at TowerLocator$.main(TowerLocator.scala:11)
at TowerLocator.main(TowerLocator.scala)

謝謝

從Eclipse啟動應用程序時,必須指定主URL。

val conf = new SparkConf().setAppName("Sample Application").setMaster("local[*]")

從shell啟動時,請使用--master參數指定它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM