提交作业时,火花提交中使用的参数是否有特定顺序



我正试图使用以下spark-submit提交一个spark-job:

> SPARK_MAJOR_VERSION=2  spark-submit --conf spark.ui.port=4090
> --driver-class-path /home/devusr/jars/greenplum-spark_2.11-1.3.0.jar  --jars /home/devusr/jars/greenplum-spark_2.11-1.3.0.jar --executor-cores 3 --executor-memory 13G --class com.partition.source.YearPartition splinter_2.11-0.1.jar --master=yarn
> --keytab /home/devusr/devusr.keytab --principal devusr@DEV.COM --files /usr/hdp/current/spark2-client/conf/hive-site.xml,testconnection.properties
> --name Splinter --conf spark.executor.extraClassPath=/home/devusr/jars/greenplum-spark_2.11-1.3.0.jar
> --conf spark.executor.instances=10 --conf spark.dynamicAllocation.enabled=false  --conf
> spark.files.maxPartitionBytes=256M

但作业没有运行,而是打印:

SPARK_MAJOR_VERSION is set to 2, using Spark2 

有人能告诉我火花提交中使用的参数是否有任何特定的顺序吗?

yarncluster模式中使用spark-submit的格式为$ ./bin/spark-submit --class path.to.your.Class --master yarn --deploy-mode cluster [options] <app jar> [app options],如https://spark.apache.org/docs/2.1.0/running-on-yarn.html

如果splinter_2.11-0.1.jar是包含类com.partition.source.YearPartition的jar,你能尝试使用这个吗:

spark-submit 
--class com.partition.source.YearPartition                                              
--master=yarn                                                                           
--conf spark.ui.port=4090                                                               
--driver-class-path /home/devusr/jars/greenplum-spark_2.11-1.3.0.jar                    
--jars /home/devusr/jars/greenplum-spark_2.11-1.3.0.jar                                 
--executor-cores 3                                                                      
--executor-memory 13G                                                                   
--keytab /home/devusr/devusr.keytab                                                     
--principal devusr@DEV.COM                                                              
--files /usr/hdp/current/spark2-client/conf/hive-site.xml,testconnection.properties     
--name Splinter                                                                         
--conf spark.executor.extraClassPath=/home/devusr/jars/greenplum-spark_2.11-1.3.0.jar   
--conf spark.executor.instances=10                                                      
--conf spark.dynamicAllocation.enabled=false                                            
--conf spark.files.maxPartitionBytes=256M                                               
splinter_2.11-0.1.jar

在编写spark-submit命令时没有正确的顺序。只有几件事需要注意。如果您在安装spark的同一目录中,则该命令应以spark-submit开头,否则您需要在spark-subject命令之前提供完整路径。火花选项和配置的顺序可以更改。但最后,您应该提供可执行的jar位置,然后提供要传递的应用程序中使用的参数。例如:

/local/spark/lib/spark-submit--master yarn--部署模式集群-火花配置/tmp/app.jar arg1 arg2

最新更新