首先将需要运行的程序打包成jar
写shell脚本
source "./conf.sh" cluster="***" master="***" # master="local" numExecutor=100 queue="***" # 参数 arg1="***" mainJar="*-0.0.1-SNAPSHOT.jar" # class名称,最后一个为scala文件名 class="com.***.***.***" spark-submit \ --cluster "$cluster" \ --class "$class" \ --master "$master" \ --queue "$queue" \ --conf spark.yarn.executor.memoryOverhead=1024 \ --conf spark.speculation=true \ --num-executors "$numExecutor" \ --driver-memory 6g \ --executor-memory 4g \ ./$mainJar "$arg1"