Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20327#discussion_r171379498
  
    --- 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 --
    
    If you move the block in L77 after the code you're adding, you don't need 
this.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to