if (!QuorumPeerConfig.isStandalone()) {
runPeer(new QuorumPeer.Factory() {
public QuorumPeer create(NIOServerCnxn.Factory cnxnFactory) throws IOException {
QuorumPeer peer = new QuorumPeer();
peer.setClientPort(ServerConfig.getClientPort());
peer.setTxnFactory(new FileTxnSnapLog(
new File(QuorumPeerConfig.getDataLogDir()),
new File(QuorumPeerConfig.getDataDir())));
peer.setQuorumPeers(QuorumPeerConfig.getServers());
peer.setElectionType(QuorumPeerConfig.getElectionAlg());
peer.setMyid(QuorumPeerConfig.getServerId());