编程语言
首页 > 编程语言> > spark-submit提交程序遇到错误,纠正记录

spark-submit提交程序遇到错误,纠正记录

作者:互联网

时间:2019年10月14日

spark程序按照如下提交任务后报错

./spark-submit --class com.idengyun.HiveToEs2 \
--conf spark.yarn.executor.memoryOverhead=6144 \
--conf spark.shuffle.io.maxRetries=100 \
--conf spark.shuffle.io.retryWait=60 \
--conf spark.task.maxFailures=10 \
--conf spark.akka.timeout=1000 \
--conf spark.network.timeout=1000 \
--conf spark.yarn.max.executor.failures=100 \
--master yarn --driver-memory 2G \
--executor-memory 4g \
--num-executors 40 \
--conf spark.default.parallelism=500 \
--executor-cores 4 \
--jars from-hive-to-es-1.0-SNAPSHOT-jar-with-dependencies.jar

报错信息为:

Exception in thread "main" java.lang.IllegalArgumentException: Missing application resource.
    at org.apache.spark.launcher.CommandBuilderUtils.checkArgument(CommandBuilderUtils.java:241)
    at org.apache.spark.launcher.SparkSubmitCommandBuilder.buildSparkSubmitArgs(SparkSubmitCommandBuilder.java:160)
    at org.apache.spark.launcher.SparkSubmitCommandBuilder.buildSparkSubmitCommand(SparkSubmitCommandBuilder.java:274)
    at org.apache.spark.launcher.SparkSubmitCommandBuilder.buildCommand(SparkSubmitCommandBuilder.java:151)
    at org.apache.spark.launcher.Main.main(Main.java:86)

原因:

提交命令的指令有误,或者命令中间有看不见的特殊字符等等

解决办法:

以下为正常指令,更换依赖,jar包和主类即可运行

spark-submit --master yarn  --class com.idengyun.transform.TransformTest --driver-memory 2G --executor-memory 6g --num-executors 80 --conf spark.default.parallelism=1000 --executor-cores 2 --executor-memory 2G  --jars /data/BDP_AI/project/common/jars/mysql-connector-java-5.1.38.jar /data/BDP/DEV/from-hive-to-es-1.0-SNAPSHOT-jar-with-dependencies.jar

标签:纠正,java,--,jar,submit,conf,executor,spark
来源: https://blog.51cto.com/u_15278282/2931957