Using Linux Service Scripts to Start and Stop Members
If you installed GemFire XD from an RPM file, Debian package, or from the Pivotal Command Center CLI (for Pivotal HD installations), then you can optionally start and stop member processes using an installed Linux service script.
Overview and Limitations
The GemFire XD service script enables you to run a single locator member, a single datastore member, or a combination of single locator and datastore member on the local machine. For GemFire XD standalone installations the script is located at /etc/init.d/gemfirexd and references an editable configuration file at /etc/sysconfig/gemfirexd. For Pivotal Command Center CLI installations the script is located at /etc/init.d/gfxd and references an editable configuration file at /etc/sysconfig/gfxd.
- The scripts are intended to run only a single GemFire XD member (or a single locator and datastore member) on the local host. If you want to run multiple datastore members on the same host in order to better utilize hardware resources, then use the gfxd utility to start and stop multiple members. See Using gfxd to Start and Stop Members.
- The configuration file for the script includes properties to configure many basic features of the local member process. These replicate the functionality of gfxd utility options such as -bind-address and -client-port. However, some gfxd command-line options are not exposed as properties in the service configuration script. To set these properties (as well as any JVM system properties), you must manually edit the service configuration script to add the option definitions to the general GFXD_ARGS= or GFXD_LOCATOR_ARGS= property definitions.
Editing the Service Configuration File
- Open the service configuration file using a text editor. For RPM or Debian package
/etc/sysconfig/gemfirexdFor Pivotal Command Center CLI installations, open:
The configuration file includes many comments to help you decide whether you need to modify it. If you do not modify the file but simply use the default, the GemFire XD service starts up a server member in a multicast configuration.
- Edit property values in the file to
configure the type of GemFire XD member to start, as well as connectivity to the
If you want the GemFire XD member process to start up using a local locator member and server, change the LOCATOR property to local:
If you use additional remote locators (on other machines), add their address and port number combinations to the LOCATOR_IP_STRING as shown in the configuration file as a commented-out example.
If you want to start up only a local locator process and not a local server instance, set the LOCATOR property to locator_only. This sets up a redundant locator configuration; be sure you add all locator IP addresses and port numbers to the LOCATOR_IP_STRING; an example is shown in the configuration file.
Set the LOCATOR property to remote if you want to start a local server instance that relies on having locator processes running on one or more remote machines. Specify these remote locators using the LOCATOR_IP_STRING property.
- If you are using one or more locators for member discovery, comment out the MCAST_PORT and MCAST_ADDRESS property definitions.
- By default, the configuration script uses client port 1527 for a local locator process and port 1529 for a local server member (if the service starts both a locator and server with LOCATOR=local). To change the client ports, edit CLIENT_PORT and CLIENT_PORT_WITH_LOCATOR as necessary.
- If you want to set any additional gfxd server or gfxd locator startup options that are not represented by properties in the configuration file, define those options in the GFXD_ARGS or GFXD_LOCATOR_ARGS properties. See the property definitions in the configuration script for more information.
- Save your changes to the configuration file and exit the text editor.
Starting and Stopping Members using the Service Script
- Start the processes associated with GemFire
XD by running the following command:
sudo service gfxd start
- To stop, restart, and get status about the
processes, pass the stop, restart, and
status parameters, respectively, to the
sudo service gfxd status sudo service gfxd restart sudo service gfxd stop
- Start the processes associated with GemFire XD by running the following command:
sudo service gemfirexd start
- To stop, restart, and get status about the processes, pass the
stop, restart, and status
parameters, respectively, to the /etc/init.d/gemfirexd script:
sudo service gemfirexd status sudo service gemfirexd restart sudo service gemfirexd stop
Configuring Automated Startup of the GemFire XD Service
To start the gfxd service automatically when the operating system starts, execute the appropriate command for your installation.
chkconfig --level 35 gemfirexd on
chkconfig --level 35 gfxd on
/usr/sbin/update-rc.d gemfirexd defaults 85 15