即使 Spark 应用程序成功执行,Yarn 资源管理器也会使应用程序失败

Yarn resource manager fails the application even though Spark application executes successfully

我是 运行 简单的 hello world python 使用 AWS EMR + Spark + Yarn 的脚本。

查看日志,即使 Spark 应用程序成功,整个作业被 Yarn 资源管理器标记为失败。

我检查了所有日志,但无法真正找出根本原因。可能是什么问题?我该如何进一步调试?

您的日志中有以下语句:-

ERROR ApplicationMaster: SparkContext did not initialize after waiting for 100000 ms. Please check earlier log output for errors. Failing the application.

如果您在 SparkSession 构建器中设置 .master(),通常会出现这种情况。