COMMAND NAME: gpstop

Stops or restarts a Apache Cloudberry system.


*****************************************************
SYNOPSIS
*****************************************************

gpstop [-d <coordinator_data_directory>] [-B <parallel_processes>] 
       [-M smart | fast | immediate] [-t <timeout_seconds>]
       [-r] [-y] [-a] [-l <logfile_directory>] [-v | -q]

gpstop [-m | -c ] [-d <coordinator_data_directory>] [-y]
       [-l <logfile_directory>] [-v | -q]

gpstop -u [-d <coordinator_data_directory>] [-l <logfile_directory>] 
       [-v | -q]

gpstop --host <segment_host_name> [-d <coordinator_data_directory>]
       [-l <logfile_directory>] [-t <timeout_seconds>] [-a]
       [-v | -q]

gpstop --version

gpstop -? | -h | --help


*****************************************************
DESCRIPTION
*****************************************************

The gpstop utility is used to stop the database servers that 
comprise a Apache Cloudberry system. When you stop a Cloudberry 
Database system, you are actually stopping several postgres 
database server processes at once (the coordinator and all of the 
segment instances). The gpstop utility handles the shutdown 
of the individual instances. Each instance is shutdown in parallel. 

By default, you are not allowed to shut down Apache Cloudberry 
if there are any client connections to the database. Use 
the -M fast option to roll back and terminate any connections 
before shutting down. If there are any transactions in progress, 
the default behavior is to wait for them to commit before 
shutting down. Use the -M fast option to roll back open 
transactions.

With the -u option, the utility uploads changes made to the 
coordinator pg_hba.conf file or to runtime configuration parameters 
in the coordinator postgresql.conf file without interruption of 
service. Note that any active sessions will not pickup the 
changes until they reconnect to the database.

*****************************************************
OPTIONS
*****************************************************

-a

 Do not prompt the user for confirmation.


-B <parallel_processes>

 The number of segments to stop in parallel. If not specified, 
 the utility will start up to 64 parallel processes depending 
 on how many segment instances it needs to stop.


-d <coordinator_data_directory>

 Optional. The coordinator host data directory. If not specified, 
 the value set for $COORDINATOR_DATA_DIRECTORY will be used.


--host <segment_host_name>

 Stop all segments on this host. Specify segment_host_name as
 it is displayed in gp_segment_configuration.

 This cannot be used together with `-m`, `-r`, `-u`, or
 `-y` options.

 This will only complete if failover segments are available.
 This will fail if the system doesn't have mirrors. It will also
 fail if the specified host has a coordinator or standby coordinator on
 it. It will also fail if the specified host has both a primary
 and its corresponding mirror on it, the same host.


-l <logfile_directory>

 The directory to write the log file. Defaults to ~/gpAdminLogs.


-m | -c | --master_only | --coordinator_only

 Optional. Shuts down a Cloudberry coordinator instance that was 
 started in maintenance mode.


-M fast

 Fast shut down. Any transactions in progress are interrupted 
 and rolled back. 


-M immediate

 Immediate shut down. Any transactions in progress are aborted. This 
 shutdown mode is not recommended, and in some circumstances can cause 
 database corruption requiring manual recovery. 

 This mode kills all postgres processes without allowing the database 
 server to complete transaction processing or clean up any temporary or 
 in-process work files. 


-M smart
 
 Smart shut down. If there are active connections, this command 
 fails with a warning. This is the default shutdown mode.


-q

 Run in quiet mode. Command output is not displayed on the 
 screen, but is still written to the log file.


-r

 Restart after shutdown is complete.

-t <timeout_seconds>

 Specifies a timeout threshold (in seconds) to wait for a 
 segment instance to shutdown. If a segment instance does not 
 shutdown in the specified number of seconds, gpstop displays 
 a message indicating that one or more segments are still in 
 the process of shutting down and that you cannot restart 
 Apache Cloudberry until the segment instance(s) are stopped. 
 This option is useful in situations where gpstop is executed 
 and there are very large transactions that need to rollback. 
 These large transactions can take over a minute to rollback 
 and surpass the default timeout period of 600 seconds.


-u

 This option reloads the pg_hba.conf files of the coordinator and 
 segments and the runtime parameters of the postgresql.conf files 
 but does not shutdown the Apache Cloudberry array. Use this 
 option to make new configuration settings active after editing 
 postgresql.conf or pg_hba.conf. Note that this only applies to 
 configuration parameters that are designated as runtime parameters.


-v

 Displays detailed status, progress and error messages output 
 by the utility.


--version

 Displays the version of this utility.


-y

 Do not stop the standby coordinator process. The default is to stop 
 the standby coordinator.


-? | -h | --help

 Displays the online help.


*****************************************************
EXAMPLES
*****************************************************

Stop a Apache Cloudberry system in smart mode:

  gpstop


Stop a Apache Cloudberry system in fast mode:

  gpstop -M fast


Stop all segment instances and then restart the system:

  gpstop -r


Stop a coordinator instance that was started in maintenance mode:

  gpstop -m


Stop all segments on a particular host, while keeping
other hosts up:

  gpstop --host sdw1


Reload the postgresql.conf and pg_hba.conf files after 
making runtime configuration parameter changes but do not 
shutdown the Apache Cloudberry array:

  gpstop -u


*****************************************************
SEE ALSO
*****************************************************

gpstart

