Starting and Stopping Greenplum Database
A newer version of this documentation is available. Use the version menu above to view the most up-to-date release of the Greenplum 4.x documentation.
Starting and Stopping Greenplum Database
In a Greenplum Database DBMS, the database server instances (the master and all segments) are started or stopped across all of the hosts in the system in such a way that they can work together as a unified DBMS.
Because a Greenplum Database system is distributed across many machines, the process for starting and stopping a Greenplum Database system is different than the process for starting and stopping a regular PostgreSQL DBMS.
Use the gpstart and gpstop utilities to start and stop Greenplum Database, respectively. These utilities are located in the $GPHOME/bin directory on your Greenplum Database master host.
Issuing a kill -9 or kill -11 might introduce database corruption. If Pivotal Greenplum Database corruption occurs, Pivotal will make best efforts to restore a cluster. A root cause analysis cannot be performed.
For information about gpstart and gpstop, see the Greenplum Database Utility Guide.
Starting Greenplum Database
Start an initialized Greenplum Database system by running the gpstart utility on the master instance.
$ gpstart
Restarting Greenplum Database
Stop the Greenplum Database system and then restart it.
$ gpstop -r
Reloading Configuration File Changes Only
Reload changes to Greenplum Database configuration files without interrupting the system.
$ gpstop -u
Starting the Master in Maintenance Mode
Start only the master to perform maintenance or administrative tasks without affecting data on the segments.
Stopping Greenplum Database
Stopping Client Processes
Greenplum Database launches a new backend process for each client connection. A Greenplum Database user with SUPERUSER privileges can cancel and terminate these client backend processes.
- pg_cancel_backend( int4 pid )
- pg_terminate_backend( int4 pid )
pg_cancel_backend() and pg_terminate_backend() return true if successful, and false otherwise.
=# SELECT usename, procpid, waiting, current_query, datname FROM pg_stat_activity;
Sample partial query output:
usename | procpid | waiting | current_query | datname ---------+----------+---------+-----------------------+--------- sammy | 31861 | f | <IDLE> in transaction | testdb billy | 31905 | t | SELECT * FROM topten; | testdb
Use the output to identify the process id (procpid) of the query or client connection.
For example, to cancel the pending query identified in the sample output above:
=# SELECT pg_cancel_backend( 31905 );