通过文件进行火花提交配置

roy*_*roy 3 apache-spark spark-submit

我正在尝试通过使用spark-submit具有一堆参数的火花部署工作

spark-submit --class Eventhub --master yarn --deploy-mode cluster --executor-memory 1024m --executor-cores 4 --files app.conf spark-hdfs-assembly-1.0.jar --conf "app.conf"

我正在寻找一种方法将所有这些标志放入文件中spark-submit以使我的spark-submit命令更简单

spark-submit --class Eventhub --master yarn --deploy-mode cluster --config-file my-app.cfg --files app.conf spark-hdfs-assembly-1.0.jar --conf "app.conf"

有人知道这是否可能吗?

Fai*_*igB 5

您可以使用--properties-file其中应包含带有开始关键字的参数,spark例如

spark.driver.memory 5g
spark.executor.memory 10g
Run Code Online (Sandbox Code Playgroud)

命令应如下所示:

spark-submit --class Eventhub --master yarn --deploy-mode cluster --properties-file <path-to-your-conf-file> --files app.conf spark-hdfs-assembly-1.0.jar --conf "app.conf"
Run Code Online (Sandbox Code Playgroud)