Shutting Down the System

Shutting Down the System

Shut down your GemFire system by using either gfsh's shutdown command or by shutting down individual members one at a time.

Using the shutdown Command

If you are using persistent regions, (members are persisting data to disk), you should use the gfsh shutdown 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 gfsh command:
By default, the shutdown command will only shut down data nodes. If you want to shut down all nodes including locators, specify the --include-locators=true parameter. For example:
gfsh>shutdown --include-locators=true
This will shut down all locators one by one, shutting down the manager last.
To shutdown all data members after a grace period, specify a time-out option (in seconds).
gfsh>shutdown --time-out=60
To shutdown all members including locators after a grace period, specify a time-out option (in seconds).
gfsh>shutdown --include-locators=true --time-out=60

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 server, issue the following gfsh command:
    gfsh>stop server --name=<...>
    gfsh>stop server --dir=<server_working_dir>
    See stop server for more details.
  • Shut down any locators. To shut down a locator, issue the following gfsh command:
    gfsh>stop locator --name=<...>
    gfsh>stop locator --dir=<locator_working_dir>
    See stop locator for more details.

Option for System Member Shutdown Behavior

The DISCONNECT_WAIT command line argument sets the maximum time for each individual step in the shutdown process. If any step takes longer than the specified amount, 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. For example:
gfsh>start server --J=-DDistributionManager.DISCONNECT_WAIT=<milliseconds>
Each process can have different DISCONNECT_WAIT settings.