SparkContext:通过Google DataProc运行Spark作业时初始化SparkContext出错。

4

SparkContext: 运行Google DataProc时初始化SparkContext出错

在将google dataproc版本从1.3.62-debian9升级到1.4-debian后,所有的spark data proc作业都开始因以下错误而失败:

22/01/09 00:36:50 INFO org.spark_project.jetty.server.Server: Started 3339ms
22/01/09 00:36:50 INFO org.spark_project.jetty.server.AbstractConnector: Started 
22/01/09 00:36:50 WARN org.apache.spark.scheduler.FairSchedulableBuilder: Fair 
Scheduler configuration file not found so jobs will be scheduled in FIFO order. To use 
fair scheduling, configure pools in fairscheduler.xml or set 
spark.scheduler.allocation.file to a file that contains the configuration.

ERROR org.apache.spark.SparkContext: Error initializing SparkContext.

java.lang.NumberFormatException: For input string: "30s"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at org.apache.hadoop.conf.Configuration.getLong(Configuration.java:1441)

我在spark配置文件或sparkConf对象中没有设置“30s”。

我在代码中初始化了SparkContext:

val conf = new SparkConf().setAppName(getMainName().toString)

val sc = new SparkContext(conf)

Spark 版本 - 2.3.0

我看到׳spark.scheduler.maxRegisteredResourcesWaitingTime׳的默认设置与其它地方的数值相同( https://spark.apache.org/docs/latest/configuration.html#spark-configuration )但我没有更改或更新它。

我不明白这个值是从哪里来的,以及为什么它与更新 dataproc 有关。


问题似乎在于您为Spark属性设置了“30s”,但它期望一个数字,即没有“s”的“30”。 - Dagang
2个回答

1

0

1.4版本的图像也即将到达生命周期结束,您可以尝试使用1.5版本。

话虽如此,问题可能出在您的应用程序上,可能会带来一些旧的Hadoop/Spark JAR包和/或配置文件,这会导致Spark出现故障。因为当您在1.4集群主节点中通过SSH执行spark-shell时,它是可以正常工作的:

val conf = new SparkConf().setAppName("test-app-name")
val sc = new SparkContext(conf)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接