code: private void runFromConfig(ServerConfig config) throws IOException
    {
      log.info("Starting server");
      try
      {
        _zkServer = new ZooKeeperServer();
  
        FileTxnSnapLog ftxn = new FileTxnSnapLog(new File(config.getDataLogDir()),
                                                 new File(config.getDataDir()));
        _zkServer.setTxnLogFactory(ftxn);
        _zkServer.setTickTime(config.getTickTime());
        _zkServer.setMinSessionTimeout(config.getMinSessionTimeout());
        _zkServer.setMaxSessionTimeout(config.getMaxSessionTimeout());
        _cnxnFactory = new NIOServerCnxnFactory();
        _cnxnFactory.configure(config.getClientPortAddress(), config.getMaxClientCnxns());
                                                
        _cnxnFactory.startup(_zkServer);
      }
      catch(InterruptedException e)
      {
        // warn, but generally this is ok
        log.warn("Server interrupted", e);
      }
    }
docs: This method is coming from <code>ZooKeeperServerMain</code> but tweaked to not block and to
  have access to <code>_zkServer</code> and <code>_cnxnFactory</code>.