Starting and Stopping Greenplum

A newer version of this documentation is available. Click here to view the most up-to-date release of the Greenplum 4.x documentation.

Starting and Stopping Greenplum

This chapter describes how to start, stop, and restart a Greenplum Database system.

Overview

Because a Greenplum Database system is distributed across many machines, the process for starting and stopping a Greenplum database management system (DBMS) is different than the process for starting and stopping a regular PostgreSQL DBMS.

In a Greenplum Database DBMS, each database server instance (the master and all segments) must be started or stopped across all of the hosts in the system in such a way that they can all work together as a unified DBMS.

Use the gpstart and gpstop utilities to start and stop the Greenplum database, respectively. These utilities are located in $GPHOME/bin of your Greenplum Database master host installation.

Important:

Do not issue a KILL command to end any Postgres process. Instead, use the database command pg_cancel_backend().

For information about gpstart and gpstop, see the Greenplum Database Utility Guide.

Starting Greenplum Database

Use the gpstart utility to start a Greenplum Database that has already been initialized by the gpinitsystem utility, but has been stopped by the gpstop utility. The gpstart utility starts the Greenplum Database by starting all the Postgres database instances of the Greenplum Database cluster. gpstart orchestrates this process and performs the process in parallel.

To start Greenplum Database

$ gpstart

Restarting Greenplum Database

The gpstop utility with the -r option can stop and then restart Greenplum Database after the shutdown completes.

To restart Greenplum Database

$ gpstop -r

Uploading Configuration File Changes Only

The gpstop utility can upload changes to the pg_hba.conf configuration file and to runtime parameters in the master postgresql.conf file without service interruption. Active sessions pick up changes when they reconnect to the database. Many server configuration parameters require a full system restart (gpstop -r) to activate. For information about server configuration parameters, see the Greenplum Database Reference Guide.

To upload runtime configuration file changes without restarting

$ gpstop -u

Starting the Master in Maintenance Mode

You can start only the master to perform maintenance or administrative tasks without affecting data on the segments. For example, you can connect to a database only on the master instance in utility mode and edit system catalog settings. For more information about system catalog tables, see the Greenplum Database Reference Guide.

To start the master in utility mode

  1. Run gpstart using the -m option:
    $ gpstart -m
  2. Connect to the master in utility mode to do catalog maintenance. For example:
    $ PGOPTIONS='-c gp_session_role=utility' psql template1
    
  3. After completing your administrative tasks, stop the master in utility mode. Then, restart it in production mode.
    $ gpstop -m
Warning:

Incorrect use of maintenance mode connections can result in an inconsistent system state. Only Technical Support should perform this operation.

Stopping Greenplum Database

The gpstop utility stops or restarts your Greenplum Database system and always runs on the master host. When activated, gpstop stops all postgres processes in the system, including the master and all segment instances.

The gpstop utility uses a default of up to 64 parallel worker threads to bring down the Postgres instances that make up the Greenplum Database cluster. The system waits for any active transactions to finish before shutting down. To stop Greenplum Database immediately, use fast mode.

To stop Greenplum Database

$ gpstop
$ gpstop -M fast