首页 > 解决方案 > PySpark 应用程序在 Yarn 集群模式下提交错误

问题描述

我正在尝试在集群模式下提交我的 PySpark 应用程序,并且在提交应用程序时出现以下错误。

注意:我的应用程序没有任何依赖项。

spark2-submit  --master yarn  --driver-memory 4g --executor-memory 8g --num-executors 50 --executor-cores 2 --conf spark.dynamicAllocation.enabled=false --py-files filepath

我收到以下错误

Exception in thread "main" java.lang.IllegalArgumentException: Missing application resource.

标签: pythonapache-sparkpyspark

解决方案


您必须将要提交的应用程序的名称作为参数传递给 spark-submit,即将应用程序的文件名添加到 spark-submit 命令的末尾。

spark2-submit  --master yarn  --driver-memory 4g --executor-memory 8g --num-executors 50 --executor-cores 2 --conf spark.dynamicAllocation.enabled=false --py-files filepath **filename.py**

推荐阅读