The gpstop tool is used to stop, restart the MatrixDB cluster, or reload the configuration. When a user stops a MatrixDB cluster, the user actually stops multiple postgres database server processes (Master and all Segment instances) at once. The gpstop tool handles the closure of each instance. Each instance is stopped in parallel.
By default, stopping is not allowed if any clients are connected to the database. You need to use the -M fast
option to roll back all running transactions and terminate all connections. If any transactions are in progress, the default behavior is to wait for them to be submitted before stopping.
Use the -u
option to reload the configuration, which will reload the configuration of the pg_hba.conf file on the Master and the runtime configuration parameters in the postgresql.conf file.
Parameter name | Description |
---|---|
-a | Do not prompt the user to confirm |
-B parallel_processes | Number of Segments to Stop in Parallel. If not specified, the tool will start up to 64 parallel processes, depending on how many Segment instances need to be stopped. |
-d master_data_directory | Master host's data directory. The value set by $MASTER_DATA_DIRECTORY is used by default. |
--host host_name | Stop all Segment nodes on this host, and the host name needs to be consistent with the gp_segment_configuration table. This option cannot be used with the -m , -r , -u , -y parameters. Only if there is a mirror node in the cluster, there cannot be a Master or Standby instance on the host, and the host cannot contain a certain Segment node and its corresponding mirror node at the same time. |
-l logfile_directory | Directory to write to the log file. The default is ~/gpAdminLogs. |
-m | Stops Master instance started in utility mode. |
-M fast | Stop quickly, any ongoing transaction will be interrupted and rolled back. |
-M immediate | Stop immediately, any ongoing transaction will abort. This mode kills all postgres processes without allowing the database to complete other cleanups such as transactions. |
-M smart | Smart stop. If an active connection exists, this command will fail with a warning. This is the default mode. |
-q | Operate in silent mode. The command output is not displayed on the screen, but is still written to the log file. |
-r | Restart the cluster. |
-t timeout_seconds | Specifies the timeout threshold (in seconds) waiting for the Segment instance to stop. If the Segment instance does not stop within the specified number of seconds, gpstop displays a message indicating that one or more segments are still in the stop process and that the MatrixDB cluster cannot be restarted until the Segment instance is stopped. This option is useful when there are very large transactions that need to be rolled back when stopping the cluster. These large transactions may take one minute to roll back and exceed a default timeout of 600 seconds. |
-u | This option will reload the pg_hba.conf file of Master and Segment and the runtime parameters in the postgresql.conf file, but will not stop the database cluster. After editing postgresql.conf or pg_hba.conf, use this option to make the new configuration take effect. Please note that this method is only applicable to runtime configuration parameters. |
-v | Shows detailed status, progress and error messages output by the tool. |
-y | Do not stop Standby instance. The default is to stop the Standby instance. |
-? or -h or --help | Show help information. |
--version | Show version information. |
Stop the MatrixDB cluster (no prompt for confirmation):
gpstop -a
Restart the MatrixDB cluster (no prompt for confirmation):
gpstop -ar
Reload the configuration:
gpstop -u