gpstop

1. Description

The gpstop utility is used to stop, restart, or reload configuration files of a MatrixDB cluster. When stopping a MatrixDB cluster, you are effectively stopping multiple postgres database server processes—namely the Master and all Segment instances. The gpstop utility manages the shutdown process across all instances, stopping them in parallel.

By default, the system does not allow a shutdown if any client connections are active. Use the -f option to force rollback of all running transactions and terminate all connections. If transactions are in progress, the default behavior is to wait for them to commit before shutting down.

Use the -u option to reload configuration settings. This reloads the pg_hba.conf file and runtime parameters from the postgresql.conf file on the Master host.

2. Options

Option Description
-a Do not prompt for confirmation.
-B parallel_processes Number of Segments to stop in parallel. If not specified, the utility launches up to 64 parallel processes, depending on the number of Segment instances to stop.
-d master_data_directory Data directory of the Master host. Defaults to the value set in $MASTER_DATA_DIRECTORY.
--host host_name Stop all Segment nodes on the specified host. The hostname must match entries in the gp_segment_configuration catalog table.
This option cannot be used with -m, -r, -u, or -y.
Available only when mirror segments exist. The host must not contain the Master or Standby instance, and must not host both a primary Segment and its corresponding mirror.
-l logfile_directory Directory to write log files. Default is ~/gpAdminLogs.
-m Stop a Master instance running in utility mode.
-M fast Fast shutdown: abort all active transactions and roll them back.
-M immediate Immediate shutdown: terminate all transactions abruptly. This mode kills all postgres processes without allowing the database to complete transaction cleanup.
-M smart Smart shutdown: the command fails with a warning if active connections exist. This is the default mode.
-q Run in quiet mode. Output is suppressed from the screen but still written to log files.
-r Restart the cluster after stopping.
-t timeout_seconds Set timeout (in seconds) for waiting for Segment instances to stop. If a Segment does not stop within the specified time, gpstop displays a message indicating that one or more Segments are still stopping. The MatrixDB cluster cannot be restarted until all Segments have fully stopped. This option is useful when large transactions require extended rollback time, potentially exceeding the default 600-second timeout.
-u Reload runtime configuration parameters from pg_hba.conf and postgresql.conf on both Master and Segments without stopping the cluster. Use this option after editing configuration files to apply changes.
Note: This method applies only to runtime configuration parameters.
-v Enable verbose mode. Display detailed status, progress, and error messages.
-y Do not stop the Standby instance. By default, the Standby is stopped.
-? or -h or --help Show help information.
--version Show version information.

3. Examples

Stop the MatrixDB cluster (without confirmation prompt):

gpstop -a

Restart the MatrixDB cluster (without confirmation prompt):

gpstop -ar

Reload configuration files:

gpstop -u