private void checkDataNodePortUnique() throws StartupException {
    Set<Integer> portSet = new HashSet<>();
    portSet.add(config.getInternalPort());
    portSet.add(config.getMqttPort());
    portSet.add(config.getRpcPort());
    portSet.add(config.getMppDataExchangePort());
    portSet.add(config.getDataRegionConsensusPort());
    portSet.add(config.getSchemaRegionConsensusPort());
    if (portSet.size() != DATANODE_PORTS) {
      throw new StartupException("ports used in datanode have repeat.");
    } else {
      LOGGER.info("DataNode port check successful.");
    }
  }
{@link DataNodeStartupCheck} checks the parameters in iotdb-datanode.properties when start and
restart.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeStartupCheck.java