|Getting Started with GemFire XD / QuickStart Tutorials|
In this tutorial you set up and start a cluster of two GemFire XD servers.
$ cd ~ $ mkdir server1 server2Each server will use its local directory to write log files, backup disk store files, a datadictionary directory for persisting data, and a single status file, .gfxdserver.ser.
$ mkdir locatorA locator maintains a list of available servers in the cluster, and updates that list as servers join and leave the cluster. Locators also load balance client connections across all available servers.
If you installed using the TAR distribution, you must first ensure that the path to the GemFire XD bin directory is part of your PATH environment variable. For example, on a Linux platform enter:
$ export PATH=$PATH:path-to-gemfirexd-installation/binOn a Windows platform enter:
c:\> set Path=%Path%;path-to-gemfirexd-installation\bin
$ gfxd locator start -dir=locator -peer-discovery-port=10101 -client-port=1527 -jmx-manager-start=true -jmx-manager-http-port=7075 Starting GemFire XD Locator using peer discovery on: 0.0.0.0 Starting network server for GemFire XD Locator at address localhost/127.0.0.1 Logs generated in /home/gpadmin/locator/gfxdlocator.log GemFire XD Locator pid: 41456 status: running
The -peer-discovery-port defines a unique connection port that all members of this GemFire XD distributed system use for communicating with one another. Always use a unique -peer-discovery-port number to avoid joining a cluster that is already running on your network. If other people might be evaluating GemFire XD on your network, choose a port number other than 10101.
The -client-port defines the connection port that client applications use to connect to this locator. In this tutorial, all GemFire XD members run on the localhost address and use different port numbers to define unique connections. In a production environment, you can specify dedicated network interfaces for member discovery or client access by using the -peer-discovery-address and -client-bind-address options.
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.
You can verify the peer and client connections in the locator startup messages.
$ gfxd server start -dir=server1 -locators=localhost -client-port=1528 Starting GemFire XD Server using locators for peer discovery: localhost Starting network server for GemFire XD Server at address localhost/127.0.0.1 Logs generated in /home/gpadmin/server1/gfxdserver.log GemFire XD Server pid: 42051 status: running Distributed system now has 2 members. Other members: 192.168.125.140(41456:locator):20431 $ gfxd server start -dir=server2 -locators=localhost -client-port=1529 Starting GemFire XD Server using locators for peer discovery: localhost Starting network server for GemFire XD Server at address localhost/127.0.0.1 Logs generated in /home/gpadmin/server2/gfxdserver.log GemFire XD Server pid: 42528 status: running Distributed system now has 3 members. Other members: 192.168.125.140(41456:locator):20431, 192.168.125.140(42051:datastore)<v1>:13160
In each command, the -locators option defines the peer discovery address to use for joining the GemFire XD distributed system. Production deployments generally use multiple locator members, in which case you would specify a comma-separated list of locator host[port] connections when starting a server.)
Again, the -client-port indicates that each server will listen for thin clients on a unique connection (localhost:1528 and localhost:1529, respectively). However, in the tutorials that follow all clients will connect using the locator instead of making direct connections to servers.
Startup messages show the cluster membership details.
By default, new GemFire XD servers host data as data stores, and are automatically added to a default server group. You can optionally specify server group membership at startup using the server-groups boot property.