Skip to content

Commit 0058b5d

Browse files
committed
SPARK-1408 Modify Spark on Yarn to point to the history server when app ...
...finishes Note this is dependent on #204 to have a working history server, but there are no code dependencies. This also fixes SPARK-1288 yarn stable finishApplicationMaster incomplete. Since I was in there I made the diagnostic message be passed properly. Author: Thomas Graves <[email protected]> Closes #362 from tgravescs/SPARK-1408 and squashes the following commits: ec89705 [Thomas Graves] Fix typo. 446122d [Thomas Graves] Make config yarn specific f5d5373 [Thomas Graves] SPARK-1408 Modify Spark on Yarn to point to the history server when app finishes
1 parent 6904750 commit 0058b5d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/running-on-yarn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ System Properties:
4242
* `spark.yarn.preserve.staging.files`, set to true to preserve the staged files(spark jar, app jar, distributed cache files) at the end of the job rather then delete them.
4343
* `spark.yarn.scheduler.heartbeat.interval-ms`, the interval in ms in which the Spark application master heartbeats into the YARN ResourceManager. Default is 5 seconds.
4444
* `spark.yarn.max.executor.failures`, the maximum number of executor failures before failing the application. Default is the number of executors requested times 2 with minimum of 3.
45+
* `spark.yarn.historyServer.address`, the address of the Spark history server (i.e. host.com:18080). The address should not contain a scheme (http://). Defaults to not being set since the history server is an optional service. This address is given to the Yarn ResourceManager when the Spark application finishes to link the application from the ResourceManager UI to the Spark history server UI.
4546

4647
# Launching Spark on YARN
4748

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration,
366366
finishReq.setAppAttemptId(appAttemptId)
367367
finishReq.setFinishApplicationStatus(status)
368368
finishReq.setDiagnostics(diagnostics)
369-
// Set tracking url to empty since we don't have a history server.
370-
finishReq.setTrackingUrl("")
369+
finishReq.setTrackingUrl(sparkConf.get("spark.yarn.historyServer.address", ""))
371370
resourceManager.finishApplicationMaster(finishReq)
372371
}
373372
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration,
347347

348348
logInfo("finishApplicationMaster with " + status)
349349
if (registered) {
350-
// Set tracking URL to empty since we don't have a history server.
351-
amClient.unregisterApplicationMaster(status, "" /* appMessage */ , "" /* appTrackingUrl */)
350+
val trackingUrl = sparkConf.get("spark.yarn.historyServer.address", "")
351+
amClient.unregisterApplicationMaster(status, diagnostics, trackingUrl)
352352
}
353353
}
354354
}

0 commit comments

Comments
 (0)