private void startInitLocator(
      final MembershipLocator<InternalDistributedMember> membershipLocatorArg)
      throws InterruptedException {

    final String locatorString = originalConfig.getStartLocator();
    if (locatorString.isEmpty()) {
      membershipLocator = membershipLocatorArg;
      return;
    }

    // when reconnecting we don't want to join with a colocated locator unless
    // there is a quorum of the old members available
    if (attemptingToReconnect && !isConnected) {
      if (quorumChecker != null) {
        logger.info("performing a quorum check to see if location services can be started early");
        if (!quorumChecker.checkForQuorum(3L * config.getMemberTimeout())) {
          logger.info("quorum check failed - not allowing location services to start early");
          return;
        }
        logger.info("Quorum check passed - allowing location services to start early");
      }
    }
    DistributionLocatorId locId = DistributionLocatorId.unmarshal(locatorString);
    try {
      startedLocator =
          InternalLocator.createLocator(locId.getPort(), NullLoggingSession.create(), null,
              logWriter, securityLogWriter, new HostAddress(locId.getHost()),
              locId.getHostnameForClients(), originalConfig.toProperties(),
              false);

      // if locator is started this way, cluster config is not enabled, set the flag correctly
      startedLocator.getConfig().setEnableClusterConfiguration(false);

      boolean startedPeerLocation = false;
      try {
        startedLocator.startPeerLocation();
        membershipLocator = startedLocator.getMembershipLocator();
        startedPeerLocation = true;
      } finally {
        if (!startedPeerLocation) {
          stopLocator();
        }
      }
    } catch (IOException e) {
      throw new GemFireIOException(
          "Problem starting a locator service",
          e);
    }
  }
Starts a locator in this JVM iff the distribution config wants one started.

@since GemFire 5.7
@param membershipLocatorArg on initial startup, a MembershipLocator provided explicitly by
       a caller, or null; on restart, the old MembershipLocator (from the previous instance of
       InternalDistributedSystem.)
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java