错误时纱线火花 运行 双倍

spark on yarn run double times when error

我用的是纱线上火花的模型,遇到问题火花会自动重启。

我想 运行 准确一次,无论成功还是失败。

有什么conf或者api可以设置吗?

我使用的是 1.5 版的 spark。

您必须将 spark.yarn.maxAppAttempts 属性 设置为 1。默认值为 yarn.resourcemanager.am.max-attempts,默认为 2。

通过代码设置属性:

SparkConf conf = new SparkConf();
conf.set("spark.yarn.maxAppAttempts", "1");

通过spark-submit提交作业时设置:

--conf spark.yarn.maxAppAttempts=1