Repository: hadoop Updated Branches: refs/heads/branch-2.6 68b1abe5c -> 11c2326ac
YARN-2859-addendum: fix the remaining issue from the previous patch. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/11c2326a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/11c2326a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/11c2326a Branch: refs/heads/branch-2.6 Commit: 11c2326acba63c0f3490127cbda369c8d133b414 Parents: 68b1abe Author: Xuan <[email protected]> Authored: Thu Nov 19 10:29:58 2015 -0800 Committer: Xuan <[email protected]> Committed: Thu Nov 19 10:29:58 2015 -0800 ---------------------------------------------------------------------- .../ApplicationHistoryServer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/11c2326a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java index a5f3ae6..24515fd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java @@ -127,10 +127,14 @@ public class ApplicationHistoryServer extends CompositeService { return this.ahsClientService; } + private InetSocketAddress getListenerAddress() { + return this.webApp.httpServer().getConnectorAddress(0); + } + @Private @VisibleForTesting public int getPort() { - return this.webApp.httpServer().getConnectorAddress(0).getPort(); + return this.getListenerAddress().getPort(); } /** @@ -278,6 +282,12 @@ public class ApplicationHistoryServer extends CompositeService { ahsClientService, "ws") .with(conf).at(bindAddress).start( new AHSWebApp(timelineDataManager, ahsClientService)); + + conf.updateConnectAddr(YarnConfiguration.TIMELINE_SERVICE_BIND_HOST, + YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS, + YarnConfiguration.DEFAULT_TIMELINE_SERVICE_WEBAPP_ADDRESS, + this.getListenerAddress()); + LOG.info("Instantiating AHSWebApp at " + getPort()); } catch (Exception e) { String msg = "AHSWebApp failed to start."; LOG.error(msg, e);
