Is it possible to start a zookeeper server instance in process, say for unit tests?

后端 未结 6 1108
难免孤独
难免孤独 2020-11-30 22:04

Calling org.apache.zookeeper.server.quorum.QuorumPeerMain.main() isn\'t working.

6条回答
  •  孤城傲影
    2020-11-30 22:31

    ServerConfig config = new ServerConfig();
    config.parse(new String[] {port, dir});
    ZooKeeperServerMain zk = new ZooKeeperServerMain();
    zk.runFromConfig(config);
    

提交回复
热议问题