private void startDistributedSystem() throws IOException {
    InternalDistributedSystem existing = InternalDistributedSystem.getConnectedInstance();
    if (existing != null) {
      // LOG: changed from config to info
      logger.info("Using existing distributed system: {}", existing);
      startCache(existing);
      return;
    }

    HostAddress thisLocator = getHostAddress(hostAddress);
    if (peerLocator) {
      String existingLocators = distributionConfig.getLocators();
      String newLocators = addLocatorIfMissing(existingLocators, thisLocator, getPort());
      if (!newLocators.equals(existingLocators)) {
        setLocatorProperties(newLocators);
      }
    }

    Properties distributedSystemProperties = new Properties();
    // LogWriterAppender is now shared via that class
    // using a DistributionConfig earlier in this method
    distributedSystemProperties.put(DistributionConfig.DS_CONFIG_NAME, distributionConfig);

    logger.info("Starting distributed system");

    internalDistributedSystem =
        InternalDistributedSystem
            .connectInternal(distributedSystemProperties, null,
                new InternalDistributedSystemMetricsService.Builder(),
                membershipLocator);

    if (peerLocator) {
      // We've created a peer location message handler - it needs to be connected to
      // the membership service in order to get membership view notifications
      membershipLocator
          .setMembership(internalDistributedSystem.getDM()
              .getDistribution().getMembership());
    }

    internalDistributedSystem.addDisconnectListener(sys -> stop(false, false, false));

    startCache(internalDistributedSystem);

    logger.info("Locator started on {}[{}]", thisLocator, getPort());

  }
Start a distributed system whose life cycle is managed by this locator. When the locator is
stopped, this distributed system will be disconnected. If a distributed system already exists,
this method will have no affect.

@since GemFire 5.7
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java