HBASE-13481 Addendum sets MASTER_HOSTNAME_KEY config

This commit is contained in:
tedyu 2015-04-19 15:16:21 -07:00
parent 176261af78
commit 3baab26d0b
1 changed files with 3 additions and 1 deletions

View File

@ -88,6 +88,7 @@ public class TestRegionServerHostname {
String hostName = addr.getHostName(); String hostName = addr.getHostName();
LOG.info("Found " + hostName + " on " + ni); LOG.info("Found " + hostName + " on " + ni);
TEST_UTIL.getConfiguration().set(HRegionServer.MASTER_HOSTNAME_KEY, hostName);
TEST_UTIL.getConfiguration().set(HRegionServer.RS_HOSTNAME_KEY, hostName); TEST_UTIL.getConfiguration().set(HRegionServer.RS_HOSTNAME_KEY, hostName);
TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS); TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
try { try {
@ -96,7 +97,8 @@ public class TestRegionServerHostname {
// there would be NUM_RS+1 children - one for the master // there would be NUM_RS+1 children - one for the master
assertTrue(servers.size() == NUM_RS+1); assertTrue(servers.size() == NUM_RS+1);
for (String server : servers) { for (String server : servers) {
assertTrue(server.startsWith(hostName+",")); assertTrue("From zookeeper: " + server + " hostname: " + hostName,
server.startsWith(hostName+","));
} }
zkw.close(); zkw.close();
} finally { } finally {