Shutting Down the System

Shut down your GemFire system by using either the shut-down-al command or by shutting down individual members one at a time.

Using the gemfire shut-down-all Command

If you are using persistent regions, (members are persisting data to disk), you should use the gemfire shut-down-all command to stop the running system in an orderly fashion. This command synchronizes persistent partitioned regions before shutting down, which makes the next startup of the distributed system as efficient as possible.

If possible, all members should be running before you shut them down so synchronization can occur. Shut down the system using the following command:
gemfire –J-DgemfirePropertyFile=mygemfire.properties shut-down-all 
In the sample command, substitute mygemfire.properties with the location of the appropriate gemfire.properties file for the distributed system you are shutting down.
If you use a separate, restricted access gfsecurity.properties file that contains security configuration, you will also need to pass that file and its configurations into the command. The shut-down-all command requires all information needed to connect to the distributed system. For example:
gemfire –J-DgemfirePropertyFile=mygemfire.properties 
-J-DgemfireSecurityPropertyFile=mygfsecurity.properties shut-down-all
Substitute the location of the appropriate files for the distributed system you are shutting down.
Note: The gemfire shut-down-all command does not shut down GemFire locators. To shut down individual locators in your distributed system, use the gemfire stop-locator command on each locator.

Shutting Down System Members Individually

If you are not using persistent regions, you can shut down the distributed system by shutting down each member in the reverse order of their startup. (See Starting Up Your System for the recommended order of member startup.)

Shut down the distributed system members according to the type of member. For example, use the following mechanisms to shut down members:
  • Use the appropriate mechanism to shut down any GemFire-connected client applications that are running in the distributed system.
  • Shut down any cache servers. To shut down a cache server, issue the following command:
    cacheserver stop
  • Shut down any locators. To shut down a locator, issue the following command:
    gemfire stop-locator -port=port -address=ipAddr -dir=locatorDir
    
    Replace port, ipAddr and locatorDir with the appropriate values.

Option for System Member Shutdown Behavior

The DISCONNECT_WAIT property sets the maximum time for each individual step in the shutdown process. If any step takes longer, it is forced to end. Each operation is given this grace period, so the total length of time the cache member takes to shut down depends on the number of operations and the DISCONNECT_WAIT setting. During the shutdown process, GemFire produces messages such as:
Disconnect listener still running
The DISCONNECT_WAIT default is 10000 milliseconds. To change it, set this system property on the Java command line used for member startup:
-DDistributionManager.DISCONNECT_WAIT=<milliseconds>
Each process can have different DISCONNECT_WAIT settings.