YARN-2713. "RM Home" link in NM should point to one of the RMs in an HA setup. (kasha)

This commit is contained in:
Karthik Kambatla 2014-10-24 15:00:12 -07:00
parent 0ac698864d
commit 683897fd02
2 changed files with 20 additions and 2 deletions

View File

@ -57,6 +57,9 @@ Release 2.7.0 - UNRELEASED
YARN-2254. TestRMWebServicesAppsModification should run against both YARN-2254. TestRMWebServicesAppsModification should run against both
CS and FS. (Zhihai Xu via kasha) CS and FS. (Zhihai Xu via kasha)
YARN-2713. "RM Home" link in NM should point to one of the RMs in an
HA setup. (kasha)
Release 2.6.0 - UNRELEASED Release 2.6.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -143,14 +143,29 @@ public class WebAppUtils {
public static String getResolvedRMWebAppURLWithoutScheme(Configuration conf, public static String getResolvedRMWebAppURLWithoutScheme(Configuration conf,
Policy httpPolicy) { Policy httpPolicy) {
InetSocketAddress address = null; InetSocketAddress address = null;
String rmId = null;
if (HAUtil.isHAEnabled(conf)) {
// If HA enabled, pick one of the RM-IDs and rely on redirect to go to
// the Active RM
rmId = (String) HAUtil.getRMHAIds(conf).toArray()[0];
}
if (httpPolicy == Policy.HTTPS_ONLY) { if (httpPolicy == Policy.HTTPS_ONLY) {
address = address =
conf.getSocketAddr(YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS, conf.getSocketAddr(
rmId == null
? YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS
: HAUtil.addSuffix(
YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS, rmId),
YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_ADDRESS, YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_ADDRESS,
YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT); YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT);
} else { } else {
address = address =
conf.getSocketAddr(YarnConfiguration.RM_WEBAPP_ADDRESS, conf.getSocketAddr(
rmId == null
? YarnConfiguration.RM_WEBAPP_ADDRESS
: HAUtil.addSuffix(
YarnConfiguration.RM_WEBAPP_ADDRESS, rmId),
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS, YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS,
YarnConfiguration.DEFAULT_RM_WEBAPP_PORT); YarnConfiguration.DEFAULT_RM_WEBAPP_PORT);
} }