ZooDiscoveryContainer.zooKeeperServer = new ZooKeeperServer();
FileTxnSnapLog fileTxnSnapLog = new FileTxnSnapLog(conf.getZookeeperDataFile(), conf.getZookeeperDataFile());
ZooDiscoveryContainer.zooKeeperServer.setTxnLogFactory(fileTxnSnapLog);
ZooDiscoveryContainer.zooKeeperServer.setTickTime(conf.getTickTime());
Factory cnxnFactory = new NIOServerCnxn.Factory(new InetSocketAddress(conf.getClientPort()));
cnxnFactory.startup(ZooDiscoveryContainer.zooKeeperServer);
} catch (Exception e) {
Logger.log(LogService.LOG_ERROR,
"Zookeeper server cannot be started! Possibly another instance is already running on the same port. ", e);
}