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

2021/6/21 17:29:28

本文主要是介绍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


这篇关于spark-submit提交程序遇到错误,纠正记录的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程