Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spark on yarn run double times when error [duplicate]

I use the model that spark on yarn,when i meet a problem the spark would restart automatic.

I want to run exact once whatever successful or fail.

Is there any conf or api can set?

I'm using spark version 1.5.

like image 938
ulysses Avatar asked Jan 12 '17 06:01

ulysses


1 Answers

You have to set spark.yarn.maxAppAttempts property to 1. Default value for this is yarn.resourcemanager.am.max-attempts which is by default 2.

Set the property via code:

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

Set when submitting the job via spark-submit:

--conf spark.yarn.maxAppAttempts=1

like image 140
code Avatar answered Oct 13 '22 12:10

code