Run application locally(本地运行)
/usr/local/spark-3.3.0/bin/spark-submit \
--master local[8] \
--class com.zxw.spark.Etl \
/opt/zxw-spark-1.0.jar hdfs://node3:8020/sdk/20230418/logs-.* hdfs://node3:8020/data/locally
Run on a Spark standalone cluster in client deploy mode
/usr/local/spark-3.3.0/bin/spark-submit \
--master spark://node3:7077 \
--class com.zxw.spark.Etl \
--driver-memory 1g \
--executor-memory 1g \
--total-executor-cores 8 \
/opt/zxw-spark-1.0.jar hdfs://node3:8020/sdk/20230418/logs-.* hdfs://node3:8020/data/spark-standalone
Run on a Spark standalone cluster in cluster deploy mode with supervise
/usr/local/spark-3.3.0/bin/spark-submit \
--master spark://node3:7077 \
--deploy-mode cluster \
--supervise \
--class com.zxw.spark.Etl \
--driver-memory 1g \
--executor-memory 1g \
--total-executor-cores 8 \
/opt/zxw-spark-1.0.jar hdfs://node3:8020/sdk/20230418/logs-.* hdfs://node3:8020/data/spark-cluster
Run on a YARN cluster export HADOOP_CONF_DIR=XXX
/usr/local/spark-3.3.0/bin/spark-submit \
--class com.zxw.spark.Etl \
--master yarn \
--driver-memory 8g \
--executor-memory 1g \
--total-executor-cores 6 \
--num-executors 2 \
--conf spark.shuffle.consolidateFiles=true \
--conf spark.driver.maxResultSize=2048M \
/opt/zxw-spark-1.0.jar hdfs://node3:8020/sdk/20230418/logs-.* hdfs://node3:8020/data/yarn
参考连接:https://blog.csdn.net/kezhong_wxl/article/details/77507361