@Test
  public void TestClusterID() throws Exception {
    HBaseRpcController rpcController = getRpcController();
    String clusterID = TEST_UTIL.getMiniHBaseCluster().getMaster().getClusterId();
    int rpcCount = 0;
    for (JVMClusterUtil.MasterThread masterThread : TEST_UTIL.getMiniHBaseCluster()
      .getMasterThreads()) {
      ClientMetaService.BlockingInterface stub =
        getMasterStub(masterThread.getMaster().getServerName());
      GetClusterIdResponse resp =
        stub.getClusterId(rpcController, GetClusterIdRequest.getDefaultInstance());
      assertEquals(clusterID, resp.getClusterId());
      rpcCount++;
    }
    assertEquals(MASTER_COUNT, rpcCount);
  }
Verifies the cluster ID from all running masters.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClientMetaServiceRPCs.java