MAPREDUCE-5404. HSAdminServer does not use ephemeral ports in minicluster mode. Contributed by Ted Yu

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1505771 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-07-22 19:05:12 +00:00
parent 11c073134a
commit 77278064a7
2 changed files with 8 additions and 2 deletions

View File

@ -164,6 +164,9 @@ Release 2.3.0 - UNRELEASED
MAPREDUCE-5380. Invalid mapred command should return non-zero exit code
(Stephen Chu via jlowe)
MAPREDUCE-5404. HSAdminServer does not use ephemeral ports in minicluster
mode (Ted Yu via jlowe)
Release 2.1.1-beta - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -151,11 +151,14 @@ public synchronized void serviceStart() throws Exception {
if (!getConfig().getBoolean(
JHAdminConfig.MR_HISTORY_MINICLUSTER_FIXED_PORTS,
JHAdminConfig.DEFAULT_MR_HISTORY_MINICLUSTER_FIXED_PORTS)) {
String hostname = MiniYARNCluster.getHostname();
// pick free random ports.
getConfig().set(JHAdminConfig.MR_HISTORY_ADDRESS,
MiniYARNCluster.getHostname() + ":0");
hostname + ":0");
getConfig().set(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
MiniYARNCluster.getHostname() + ":0");
hostname + ":0");
getConfig().set(JHAdminConfig.JHS_ADMIN_ADDRESS,
hostname + ":0");
}
historyServer = new JobHistoryServer();
historyServer.init(getConfig());