Skip to content

Commit c096493

Browse files
gerashegalovjerryshao
authored andcommitted
[SPARK-23956][YARN] Use effective RPC port in AM registration
## What changes were proposed in this pull request? We propose not to hard-code the RPC port in the AM registration. ## How was this patch tested? Tested application reports from a pseudo-distributed cluster ``` 18/04/10 14:56:21 INFO Client: client token: N/A diagnostics: N/A ApplicationMaster host: localhost ApplicationMaster RPC port: 58338 queue: default start time: 1523397373659 final status: UNDEFINED tracking URL: http://localhost:8088/proxy/application_1523370127531_0016/ ``` Author: Gera Shegalov <[email protected]> Closes apache#21047 from gerashegalov/gera/am-to-rm-nmhost.
1 parent 73f2853 commit c096493

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnRMClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import org.apache.spark.{SecurityManager, SparkConf}
2929
import org.apache.spark.deploy.yarn.config._
3030
import org.apache.spark.internal.Logging
3131
import org.apache.spark.rpc.RpcEndpointRef
32-
import org.apache.spark.util.Utils
3332

3433
/**
3534
* Handles registering and unregistering the application with the YARN ResourceManager.
@@ -71,7 +70,8 @@ private[spark] class YarnRMClient extends Logging {
7170

7271
logInfo("Registering the ApplicationMaster")
7372
synchronized {
74-
amClient.registerApplicationMaster(Utils.localHostName(), 0, trackingUrl)
73+
amClient.registerApplicationMaster(driverRef.address.host, driverRef.address.port,
74+
trackingUrl)
7575
registered = true
7676
}
7777
new YarnAllocator(driverUrl, driverRef, conf, sparkConf, amClient, getAttemptId(), securityMgr,

0 commit comments

Comments
 (0)