use of com.ctrip.xpipe.redis.core.metaserver.impl.DefaultMetaServerConsoleService 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.core.metaserver.impl.DefaultMetaServerConsoleService in project x-pipe by ctripcorp.
the class ClusterServersApiTest method testMakeMasterReadOnly.
@Test
public void testMakeMasterReadOnly() throws Exception {
createMetaServers(metaServerCount);
sleep(waitForMetaServerOkTime);
logger.info(remarkableMessage("[testMakeMasterReadOnly][begin send make master read only message]"));
for (TestMetaServer server : getServers()) {
logger.info("[testChangePrimaryDcCheck]{}", server.getAddress());
MetaServerConsoleService consoleService = new DefaultMetaServerConsoleService(server.getAddress());
MetaServerConsoleService.PreviousPrimaryDcMessage message = consoleService.makeMasterReadOnly(getClusterId(), getShardId(), true);
logger.info("[testMakeMasterReadOnly][true]{}", message);
message = consoleService.makeMasterReadOnly(getClusterId(), getShardId(), false);
logger.info("[testMakeMasterReadOnly][false]{}", message);
}
}
use of com.ctrip.xpipe.redis.core.metaserver.impl.DefaultMetaServerConsoleService in project x-pipe by ctripcorp.
the class ClusterServersApiTest method testDoChangePrimaryDc.
@Test
public void testDoChangePrimaryDc() throws Exception {
createMetaServers(metaServerCount);
sleep(waitForMetaServerOkTime);
logger.info(remarkableMessage("[testDoChangePrimaryDc][begin send change primary dc message]"));
for (TestMetaServer server : getServers()) {
logger.info(remarkableMessage("[testDoChangePrimaryDc][jq]"));
MetaServerConsoleService.PrimaryDcChangeRequest request = new MetaServerConsoleService.PrimaryDcChangeRequest();
request.setMasterInfo(new MasterInfo(RunidGenerator.DEFAULT.generateRunid(), 100L));
MetaServerConsoleService consoleService = new DefaultMetaServerConsoleService(server.getAddress());
PrimaryDcChangeMessage message = consoleService.doChangePrimaryDc(getClusterId(), getShardId(), "jq", request);
logger.info("{}", message);
logger.info(remarkableMessage("[testDoChangePrimaryDc][oy]"));
message = consoleService.doChangePrimaryDc(getClusterId(), getShardId(), "oy", request);
logger.info("{}", message);
}
}
Aggregations