|Configuring Discovery Mechanisms / Using Locators|
You start and stop locators with the gfxd locator command. The command line options determine the address and port at which GemFire XD peers communicate with the locator, as well as the address and port that thin clients use to connect to the GemFire XD cluster using the locator.
Always start locator members first when you start a GemFire XD cluster. This ensures that the locators can manage server discovery from the beginning, as individual GemFire XD servers join and leave the cluster.
If your cluster uses multiple locators, specify the complete list of locator addresses and ports when you start each locator.
gfxd locator start -peer-discovery-address=locator1host -peer-discovery-port=10101 \ -locators=locator1host,locator2host \ -client-bind-address=locator1host -client-port=1527 -dir=locator1 -jmx-manager-start=true
The -peer-discovery-address and -peer-discovery-port options define a unique connection that all members of this GemFire XD distributed system use for communicating with the locator (see Start and Stop Locators). The -client-bind-address and -client-port options define a connection that client applications can use to connect to the cluster using this locator (see Connect to a Distributed System Using Locators).
The -locators option lists the peer connection information for all locators used in the same GemFire XD distributed system. The command above specifies a distributed system with two locators. The second locator would be started using a similar command:
gfxd locator start -peer-discovery-address=locator2host -peer-discovery-port=20202 \ -locators=locator1host,locator2host \ -client-bind-address=locator2host -client-port=1528 -dir=locator2 -jmx-manager-start=true
All log and status files are stored in the specified directories (or in the current working directory if you omit the -dir option).
Configure Locators for WAN Member Discovery provides additional information about starting locators for WAN replication.
Specifying -jmx-manager-start=true starts an embedded JMX Manager within the locator. By starting a JMX Manager, you can monitor and browse the GemFire XD distributed system through the Pulse graphical interface.
gfxd locator stop -dir=locator_directory
To stop an entire GemFire XD distributed system, always use the shut-down-all command. This command stops all data stores and accessors in the system, but leaves locators running. If necessary, shut down locators individually, but only after all data stores in the system have finished shutting down.