Search in sources :

Example 1 with DcInfo

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());
}
Also used : DcInfo(com.ctrip.xpipe.redis.integratedtest.DcInfo) TestMetaServer(com.ctrip.xpipe.redis.meta.server.TestMetaServer)

Example 2 with DcInfo

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);
            }
        }
    }
}
Also used : DcInfo(com.ctrip.xpipe.redis.integratedtest.DcInfo) MetaServerKeeperService(com.ctrip.xpipe.redis.core.metaserver.MetaServerKeeperService) LeaderElectorManager(com.ctrip.xpipe.api.cluster.LeaderElectorManager)

Aggregations

DcInfo (com.ctrip.xpipe.redis.integratedtest.DcInfo)2 LeaderElectorManager (com.ctrip.xpipe.api.cluster.LeaderElectorManager)1 MetaServerKeeperService (com.ctrip.xpipe.redis.core.metaserver.MetaServerKeeperService)1 TestMetaServer (com.ctrip.xpipe.redis.meta.server.TestMetaServer)1