void startServerLocation(InternalDistributedSystem distributedSystem) throws IOException {
    if (isServerLocator()) {
      throw new IllegalStateException(
          String.format("Server location is already running for %s", this));
    }
    logger.info("Starting server location for {}", this);

    if (distributedSystem == null) {
      distributedSystem = InternalDistributedSystem.getConnectedInstance();
      if (distributedSystem == null) {
        throw new IllegalStateException(
            "Since server location is enabled the distributed system must be connected.");
      }
    }

    ServerLocator serverLocator =
        new ServerLocator(getPort(), getBindAddressString(), hostnameForClients,
            logFile, getConfig().getName(), distributedSystem, locatorStats);
    restartHandlers.add(serverLocator);
    membershipLocator.addHandler(LocatorListRequest.class, serverLocator);
    membershipLocator.addHandler(ClientConnectionRequest.class, serverLocator);
    membershipLocator.addHandler(QueueConnectionRequest.class, serverLocator);
    membershipLocator.addHandler(ClientReplacementRequest.class, serverLocator);
    membershipLocator.addHandler(GetAllServersRequest.class, serverLocator);
    membershipLocator.addHandler(LocatorStatusRequest.class, serverLocator);

    this.serverLocator = serverLocator;
    if (!membershipLocator.isAlive()) {
      startTcpServer();
    }
  }
Start server location services in this locator. Server location can only be started once there
is a running distributed system.

@param distributedSystem The distributed system which the server location services should use.
       If null, the method will try to find an already connected distributed system.
@since GemFire 5.7
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java