Skip to content

Commit d4001c7

Browse files
committed
SPARK-1211. In ApplicationMaster, set spark.master system property to "yarn-cluster"
1 parent 5d98cfc commit d4001c7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration,
7979
// other spark processes running on the same box
8080
System.setProperty("spark.ui.port", "0")
8181

82+
// when running the AM, the Spark master is always "yarn-cluster"
83+
System.setProperty("spark.master", "yarn-cluster")
84+
8285
// Use priority 30 as its higher then HDFS. Its same priority as MapReduce is using.
8386
ShutdownHookManager.get().addShutdownHook(new AppMasterShutdownHook(this), 30)
8487

yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration,
8282
// other spark processes running on the same box
8383
System.setProperty("spark.ui.port", "0")
8484

85+
// when running the AM, the Spark master is always "yarn-cluster"
86+
System.setProperty("spark.master", "yarn-cluster")
87+
8588
// Use priority 30 as it's higher then HDFS. It's same priority as MapReduce is using.
8689
ShutdownHookManager.get().addShutdownHook(new AppMasterShutdownHook(this), 30)
8790

0 commit comments

Comments
 (0)