use of com.ctrip.xpipe.redis.integratedtest.DcInfo 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.integratedtest.DcInfo in project x-pipe by ctripcorp.
the class AbstractFullIntegrated method startDc.
protected void startDc(String dc) throws Exception {
logger.info(remarkableMessage("[startDc]{}"), dc);
DcMeta dcMeta = getXpipeMeta().getDcs().get(dc);
DcInfo dcInfo = dcs.get(dc);
if (dcMeta == null || dcInfo == null) {
throw new IllegalStateException("dc not found:" + dc);
}
DefaultFoundationService.setDataCenter(dc);
startZkServer(dcMeta.getZkServer());
startMetaServers(dcMeta);
MetaServerKeeperService metaService = createMetaService(dcMeta.getMetaServers());
LeaderElectorManager leaderElectorManager = createLeaderElectorManager(dcMeta);
logger.info("[startDc]{}\n\n", dc);
for (ClusterMeta clusterMeta : dcMeta.getClusters().values()) {
logger.info(remarkableMessage("[startCluster]{}"), clusterMeta.getId());
for (ShardMeta shardMeta : clusterMeta.getShards().values()) {
logger.info(remarkableMessage("[startShard]{}"), shardMeta.getId());
for (KeeperMeta keeperMeta : shardMeta.getKeepers()) {
startKeeper(keeperMeta, metaService, leaderElectorManager);
}
for (RedisMeta redisMeta : shardMeta.getRedises()) {
startRedis(redisMeta);
}
}
}
}
Aggregations