gpstate

Shows the status of a running Greenplum Database system.

Synopsis

  1. gpstate [-d master_data_directory] [-B parallel_processes]
  2. [-s | -b | -Q | -e] [-m | -c] [-p] [-i] [-f] [-v | -q] | -x
  3. [-l log_directory]
  4. gpstate -? | -h | --help

Description

The gpstate utility displays information about a running Greenplum Database instance. There is additional information you may want to know about a Greenplum Database system, since it is comprised of multiple PostgreSQL database instances (segments) spanning multiple machines. The gpstate utility provides additional status information for a Greenplum Database system, such as:

  • Which segments are down.
  • Master and segment configuration information (hosts, data directories, etc.).
  • The ports used by the system.
  • A mapping of primary segments to their corresponding mirror segments.

Options

-b (brief status)

Optional. Display a brief summary of the state of the Greenplum Database system. This is the default option.

-B parallel_processes

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

-c (show primary to mirror mappings)

Optional. Display mapping of primary segments to their corresponding mirror segments.

-d master_data_directory

Optional. The master data directory. If not specified, the value set for $MASTER_DATA_DIRECTORY will be used.

-e (show segments with mirror status issues)

Show details on primary/mirror segment pairs that have potential issues such as 1) the active segment is running in change tracking mode, meaning a segment is down 2) the active segment is in resynchronization mode, meaning it is catching up changes to the mirror 3) a segment is not in its preferred role, for example a segment that was a primary at system initialization time is now acting as a mirror, meaning you may have one or more segment hosts with unbalanced processing load.

-f (show standby master details)

Display details of the standby master host if configured.

-i (show Greenplum Database version)

Display the Greenplum Database software version information for each instance.

-l logfile_directory

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

-m (list mirrors)

Optional. List the mirror segment instances in the system, their current role, and synchronization status.

-p (show ports)

List the port numbers used throughout the Greenplum Database system.

-q (no screen output)

Optional. Run in quiet mode. Except for warning messages, command output is not displayed on the screen. However, this information is still written to the log file.

-Q (quick status)

Optional. Checks segment status in the system catalog on the master host. Does not poll the segments for status.

-s (detailed status)

Optional. Displays detailed status information for the Greenplum Database system.

-v (verbose output)

Optional. Displays error messages and outputs detailed status and progress information.

-x (expand)

Optional. Displays detailed information about the progress and state of a Greenplum system expansion.

-? | -h | —help (help)

Displays the online help.

Output Field Definitions

The following output fields are reported by gpstate -s for the master:

Table 1. gpstate output data for the master
Output DataDescription
Master hosthost name of the master
Master postgres process IDPID of the master database listener process
Master data directoryfile system location of the master data directory
Master portport of the master postgres database listener process
Master current roledispatch = regular operating mode

utility = maintenance mode

Greenplum array configuration typeStandard = one NIC per host

Multi-Home = multiple NICs per host

Greenplum initsystem versionversion of Greenplum Database when system was first initialized
Greenplum current versioncurrent version of Greenplum Database
Postgres versionversion of PostgreSQL that Greenplum Database is based on
Greenplum mirroring statusphysical mirroring or none
Master standbyhost name of the standby master
Standby master statestatus of the standby master: active or passive

The following output fields are reported by gpstate -s for each segment:

Table 2. gpstate output data for segments
Output DataDescription
Hostnamesystem-configured host name
Addressnetwork address host name (NIC name)
Datadirfile system location of segment data directory
Portport number of segment postgres database listener process
Current Rolecurrent role of a segment: Mirror or Primary
Preferred Rolerole at system initialization time: Mirror or Primary
Mirror Statusstatus of a primary/mirror segment pair:

Synchronized = data is up to date on both

Resynchronization = data is currently being copied from one to the other

Change Tracking = segment down and active segment is logging changes

Change tracking data sizewhen in Change Tracking mode, the size of the change log file (may grow and shrink as compression is applied)
Estimated total data to synchronizewhen in Resynchronization mode, the estimated size of data left to synchronize
Data synchronizedwhen in Resynchronization mode, the estimated size of data that has already been synchronized
Estimated resync progress with mirrorWhen in Resynchronization mode, the estimated percentage of completion
Estimated resync end timewhen in Resynchronization mode, the estimated time to complete
File postmaster.pidstatus of postmaster.pid lock file: Found or Missing
PID from postmaster.pid filePID found in the postmaster.pid file
Lock files in /tmpa segment port lock file for its postgres process is created in /tmp (file is removed when a segment shuts down)
Active PIDactive process ID of a segment
Master reports status assegment status as reported in the system catalog: Up or Down
Database statusstatus of Greenplum Database to incoming requests: Up, Down, or Suspended. A Suspended state means database activity is temporarily paused while a segment transitions from one state to another.

The following output fields are reported by gpstate -f for standby master replication status:

Table 3. gpstate output data for master replication
Output DataDescription
Standby addresshostname of the standby master
Standby data dirfile system location of the standby master data directory
Standby portport of the standby master postgres database listener process
Standby PIDprocess ID of the standby master
Standby statusstatus of the standby master: Standby host passive
WAL Sender Statewrite-ahead log (WAL) streaming state: streaming, startup,backup, catchup
Sync stateWAL sender synchronization state: sync
Sent LocationWAL sender transaction log (xlog) record sent location
Flush LocationWAL receiver xlog record flush location
Replay Locationstandby xlog record replay location

Examples

Show detailed status information of a Greenplum Database system:

  1. gpstate -s

Do a quick check for down segments in the master host system catalog:

  1. gpstate -Q

Show information about mirror segment instances:

  1. gpstate -m

Show information about the standby master configuration:

  1. gpstate -f

Display the Greenplum software version information:

  1. gpstate -i

See Also

gpstart, gpexpandgplogfilter

Need help? Visit the Greenplum Database Community