Skip to main content

Service Locator configuration with multiple machines as standalone

You may need to update some of these values if the containers are not all on the same machine. This section describes an example scenario, where two containers are accessing the Service Locator, which may be in a third container.

  • If the containers are running on different machines, then replace "localhost" with the actual IP address.

  • You may also need to check the endpoint prefixes that are to be published within the locator.

  1. Examine the properties in the file locator.properties in each container which uses the Service Locator.

  2. The locator.endpoints property is set to where the Service Locator is running - this is the normal preset value:
    locator.endpoints=localhost:2181
    If the services share the same Service Locator, this needs to be the same in each configuration file. Replace "localhost" with the IP address of where the locator is running, for example, if the IP of where Service Locator is running is 192.168.0.5:
    locator.endpoints=192.168.0.5:2181
  3. The endpoint prefixes may also need to be updated - the default configuration uses localhost (as described in the properties table of Configuring the Service Locator):
    endpoint.http.prefix=http://localhost:8040/services
    endpoint.https.prefix=https://localhost:9001/services
    • If the IP of a container is 192.168.0.10:

      endpoint.http.prefix=http://localhost:8040/services should be replaced with: endpoint.http.prefix=http://192.168.0.10:8040/services.

    • If the IP of a second container is 192.168.0.20:

      endpoint.http.prefix=http://localhost:8040/services should be replaced with: endpoint.http.prefix=http://192.168.0.20:8040/services.

    • If a second container is running on the same host as the first container:

      endpoint.http.prefix=http://localhost:8041/services should be replaced with endpoint.http.prefix=http://192.168.0.10:8041/services.

This above provides just an example; you may need to update your own deployment differently, depending on its configuration.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!