public void createPeerForConsensusGroup(List<TConfigNodeLocation> configNodeLocations)
      throws ConsensusException {
    LOGGER.info("createPeerForConsensusGroup {}...", configNodeLocations);

    List<Peer> peerList = new ArrayList<>();
    for (TConfigNodeLocation configNodeLocation : configNodeLocations) {
      peerList.add(
          new Peer(
              DEFAULT_CONSENSUS_GROUP_ID,
              configNodeLocation.getConfigNodeId(),
              configNodeLocation.getConsensusEndPoint()));
    }
    consensusImpl.createLocalPeer(DEFAULT_CONSENSUS_GROUP_ID, peerList);
  }
Create peer in new node to build consensus group.

@param configNodeLocations All registered ConfigNodes
@throws ConsensusException When addPeer doesn't success
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java