问题
I have an AWS EMR cluster (emr-4.2.0, Spark 1.5.2), where I am submitting steps from aws cli. My problem is, that if the Spark application fails, then YARN is trying to run the application again (under the same EMR step). How can I prevent this?
I was trying to set --conf spark.yarn.maxAppAttempts=1
, which is correctly set in Environment/Spark Properties, but it doesn't prevent YARN from restarting the application.
回答1:
You should try to set spark.task.maxFailures
to 1 (4 by default).
Meaning:
Number of failures of any particular task before giving up on the job. The total number of failures spread across different tasks will not cause the job to fail; a particular task has to fail this number of attempts. Should be greater than or equal to 1. Number of allowed retries = this value - 1.
来源:https://stackoverflow.com/questions/34660491/how-to-prevent-emr-spark-step-from-retrying