YARN-5905. Update the RM webapp host that is reported as part of Federation membership to current primary RM's IP.

(cherry picked from commit e0f0e7afed51aac4ac9093ac362f6ce64601884d)
This commit is contained in:
Subru Krishnan 2016-11-22 18:30:40 -08:00 committed by Carlo Curino
parent 4128c9522d
commit 78032e51d9
2 changed files with 12 additions and 3 deletions

View File

@ -177,8 +177,8 @@ private void registerAndInitializeHeartbeat() {
config.getSocketAddr(YarnConfiguration.RM_ADMIN_ADDRESS,
YarnConfiguration.DEFAULT_RM_ADMIN_ADDRESS,
YarnConfiguration.DEFAULT_RM_ADMIN_PORT));
String webAppAddress =
WebAppUtils.getResolvedRemoteRMWebAppURLWithoutScheme(config);
String webAppAddress = getServiceAddress(NetUtils
.createSocketAddr(WebAppUtils.getRMWebAppURLWithScheme(config)));
SubClusterInfo subClusterInfo = SubClusterInfo.newInstance(subClusterId,
amRMAddress, clientRMAddress, rmAdminAddress, webAppAddress,

View File

@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.StringReader;
import java.net.UnknownHostException;
import javax.xml.bind.JAXBException;
@ -157,12 +158,20 @@ private void checkClusterMetricsInfo(String capability, int numNodes)
}
private String checkSubClusterInfo(SubClusterState state)
throws YarnException {
throws YarnException, UnknownHostException {
Assert.assertNotNull(stateStore.getSubCluster(request));
SubClusterInfo response =
stateStore.getSubCluster(request).getSubClusterInfo();
Assert.assertEquals(state, response.getState());
Assert.assertTrue(response.getLastHeartBeat() >= lastHearbeatTS);
String expectedAddress =
(response.getClientRMServiceAddress().split(":"))[0];
Assert.assertEquals(expectedAddress,
(response.getAMRMServiceAddress().split(":"))[0]);
Assert.assertEquals(expectedAddress,
(response.getRMAdminServiceAddress().split(":"))[0]);
Assert.assertEquals(expectedAddress,
(response.getRMWebServiceAddress().split(":"))[0]);
lastHearbeatTS = response.getLastHeartBeat();
return response.getCapability();
}