spark-submit --class com.data.Test --master yarn-cluster --executor-memory 1G --num-executors 8 --executor-cores 2 --queue test_queue hdfs:user/test.jar arg1 arg2 spark-sql --queue test_queue --deploy-mode client --num-executors 10 --executor-memory 10g --executor-cores 5 spark-shell --queue test_queue2.参数说明
| 参数 | 参数说明 | 举例 |
|---|---|---|
| --master | master的地址,即提交任务在哪里执行 | Spark启动时的master参数以及Spark的部署方式_三丰的专栏-CSDN博客_pyspark setmaster |
| --deploy-mode | driver程序运行的位置 | client:driver程序运行在client端 cluster:driver程序运行在某个worker上 |
| --queue | 提交大yarn集群使用的队列 | --queue test |
| --num-executors | 启动executor个数,默认2,在yarn中使用 | --num-executors 100,设置的太多的话,队列可能无法给予充分的资源 |
| --executor-memory | 每个executor的内存,默认1G | --executor-memory 10G |
| --executor-cores | 每个executor的核数,在yarn或者standalone下使用 | --executor-core 2 |
| --class | 程序的主类,主要是Java或scala | |
| --jars | spark依赖的jar,逗号分割 | hoodie-hive-0.4.7.jar,hoodie-common-0.4.7.jar |
| --py-files | 依赖的python文件 | --py-files test.py |
| --driver-memory | 设置Driver的内存大小,默认为1G | --driver-memory 5G |
| --conf key=value | 设置spark 属性值 | --conf spark.executor.memoryOverhead=4G |
| --packages | 包含在driver 和executor 的 classpath 中的 jar 的 maven 坐标,写法为 groupId:artifactId:version 在首次运行的时候会自动下载 | org.apache.spark:spark-sql-kafka-0-10_2.11:2.4.0 |



