Github user gerashegalov commented on a diff in the pull request:
https://github.com/apache/spark/pull/20327#discussion_r171747629
--- Diff:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
---
@@ -79,6 +80,19 @@ private[spark] class ApplicationMaster(args:
ApplicationMasterArguments) extends
private val yarnConf = new
YarnConfiguration(SparkHadoopUtil.newConfiguration(sparkConf))
+ if (isClusterMode) {
+ // this logic replicates the way YARN NM determines the address to
bind listeners to
+ // from yarnConf
+ //
+ val nmHostPort = WebAppUtils.getWebAppBindURL(yarnConf,
YarnConfiguration.NM_BIND_HOST,
+ WebAppUtils.getNMWebAppURLWithoutScheme(yarnConf))
+ val (nmHost, _) = Utils.parseHostPort(nmHostPort)
+
+ sparkConf.set(DRIVER_HOST_ADDRESS, nmHost)
+ // propagate to the user class
+ System.setProperty(DRIVER_HOST_ADDRESS.key, nmHost)
--- End diff --
good catch. done
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]