Skip to content

Commit

Permalink
also ignore it in standalone cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
WangTaoTheTonic committed Nov 11, 2014
1 parent 2286e6b commit ff8d5f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class SparkContext(config: SparkConf) extends SparkStatusAPI with Logging {
if (master == "yarn-client") System.setProperty("SPARK_YARN_MODE", "true")

// Set Spark driver host and port system properties. Ignore host setting in yarn-cluster mode.
if (master == "yarn-cluster") {
if (master.contains("cluster")) {
conf.set("spark.driver.host", Utils.localHostName())
} else {
conf.setIfMissing("spark.driver.host", Utils.localHostName())
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ object Client {
}
conf.set("spark.akka.askTimeout", "10")
conf.set("akka.loglevel", driverArgs.logLevel.toString.replace("WARN", "WARNING"))

// Set the web ui port to be ephemeral so we don't conflict with other spark processes
// running on the same box
conf.set("spark.ui.port", "0")

// Set the master property to match the requested mode.
conf.set("spark.master", "standalone-cluster")

Logger.getRootLogger.setLevel(driverArgs.logLevel)

val (actorSystem, _) = AkkaUtils.createActorSystem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApplicationMasterArguments(val args: Array[String]) {

var args = inputArgs

while (! args.isEmpty) {
while (!args.isEmpty) {
// --num-workers, --worker-memory, and --worker-cores are deprecated since 1.0,
// the properties with executor in their names are preferred.
args match {
Expand Down

0 comments on commit ff8d5f7

Please sign in to comment.