use of com.ctrip.xpipe.redis.meta.server.TestMetaServer in project x-pipe by ctripcorp.
the class ClusterServersApiTest method testChangePrimaryDcCheck.
@Test
public void testChangePrimaryDcCheck() throws Exception {
createMetaServers(metaServerCount);
sleep(waitForMetaServerOkTime);
logger.info(remarkableMessage("[testChangePrimaryDcCheck][begin send primary dc check message]"));
for (TestMetaServer server : getServers()) {
logger.info("[testChangePrimaryDcCheck]{}", server.getAddress());
MetaServerConsoleService consoleService = new DefaultMetaServerConsoleService(server.getAddress());
PrimaryDcCheckMessage message = consoleService.changePrimaryDcCheck(getClusterId(), getShardId(), "newPrimaryDc");
logger.info("[testChangePrimaryDcCheck]{}, {}", server.getAddress(), message);
}
}
use of com.ctrip.xpipe.redis.meta.server.TestMetaServer in project x-pipe by ctripcorp.
the class ClusterServersApiTest method testGetActiveKeeper.
@Test
public void testGetActiveKeeper() throws Exception {
createMetaServers(metaServerCount);
sleep(waitForMetaServerOkTime);
logger.info(remarkableMessage("[testUpdateUpstream][begin send upstream update message]"));
for (TestMetaServer server : getServers()) {
String path = META_SERVER_SERVICE.GET_ACTIVE_KEEPER.getRealPath(server.getAddress());
logger.info("[testGetActiveKeeper]{}", path);
KeeperMeta keeperMeta = restTemplate.getForObject(path, KeeperMeta.class, "cluster1", "shard1");
logger.info("[testGetActiveKeeper]{}", keeperMeta);
}
}
use of com.ctrip.xpipe.redis.meta.server.TestMetaServer in project x-pipe by ctripcorp.
the class AbstractFullIntegrated method startMetaServer.
protected void startMetaServer(MetaServerMeta metaServerMeta, ZkServerMeta zkServerMeta, DcMeta dcMeta) throws Exception {
logger.info(remarkableMessage("[startMetaServer]{}, {}"), metaServerMeta, zkServerMeta);
DcInfo dcInfo = getDcInfos().get(dcMeta.getId());
TestMetaServer testMetaServer = new TestMetaServer(dcInfo.getIncreaseServerId(), metaServerMeta.getPort(), zkServerMeta.getAddress(), getXpipeMetaConfigFile());
testMetaServer.initialize();
testMetaServer.start();
add(testMetaServer);
dcInfo.setApplicationContext(testMetaServer.getContext());
}
use of com.ctrip.xpipe.redis.meta.server.TestMetaServer in project x-pipe by ctripcorp.
the class ClusterServerShardingTest method testInit.
@Test
public void testInit() throws Exception {
createMetaServers(serverCount);
sleep(sleepForBalance);
for (TestMetaServer server : getServers()) {
ApplicationContext context = server.getContext();
SlotManager slotManager = context.getBean(SlotManager.class);
slotManager.refresh();
logger.info("[testInit]{}", server);
AssertBalance(slotManager);
}
}
use of com.ctrip.xpipe.redis.meta.server.TestMetaServer in project x-pipe by ctripcorp.
the class ClusterServerShardingTest method testShutdownOther.
@Test
public void testShutdownOther() throws Exception {
createMetaServers(serverCount);
sleep(sleepForBalance);
for (TestMetaServer server : getServers()) {
if (!server.isLeader()) {
logger.info(remarkableMessage("[testShutdownOther][begin]{}"), server);
server.stop();
logger.info(remarkableMessage("[testShutdownOther][ end ]{}"), server);
break;
}
}
sleep(TestMetaServer.getWaitforrestarttimemills() + 1000);
TestMetaServer leader = getLeader();
SlotManager slotManager = leader.getContext().getBean(SlotManager.class);
slotManager.refresh();
Assert.assertEquals(serverCount - 1, slotManager.allServers().size());
AssertBalance(slotManager);
}
Aggregations