gpstate
Shows the status of a running Greengage DB system.
Synopsis
gpstate [ -d <master_data_directory> ]
[ -B <parallel_processes> ]
[ -s | -b | -Q | -e ]
[ -m | -c ]
[ -p ]
[ -i ]
[ -f ]
[ -v | -q ]
[ -x ]
[ -l <log_directory> ]
gpstate -? | -h | --help
Description
The gpstate utility displays information about a running Greengage DB instance.
There is additional information you may want to know about a Greengage DB system, since it is comprised of multiple PostgreSQL database instances (segments) spanning multiple machines:
-
Which segments are down.
-
Master and segment configuration information (hosts, data directories, and so on).
-
The ports used by the system.
-
A mapping of primary segments to their corresponding mirror segments.
Options
- -b
-
(Optional) Display a brief summary of the state of the Greengage DB 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
-
(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 details on primary/mirror segment pairs that have potential issues:
-
Whether any segments are down.
-
Whether any primary-mirror segment pairs are not in their preferred roles.
-
Whether any primary-mirror segment pairs are out of sync — including information on how many bytes are remaining to sync (as displayed in the
WAL sync remaining bytesoutput field).NOTEgpstate -edoes not display segment pairs that are in sync.NOTEYou must have
rsyncversion 3.1.x or higher installed in order to view the tracking information for segments undergoing a differential recovery.
-
- -f
-
Display details of the standby master host if configured.
- -i
-
Display the Greengage DB software version information for each instance.
- -m
-
(Optional) List the mirror segment instances in the system and their current role.
- -p
-
List the port numbers used throughout the Greengage DB system.
- -q
-
(Optional) Run in quiet mode. Except for warning messages, command output is not displayed on the screen but is still written to the log file.
- -Q
-
(Optional) Check segment status in the system catalog on the master host; does not poll the segments for status.
- -s
-
(Optional) Display detailed status information about the Greengage DB system.
- -v
-
(Optional) Display error messages and outputs detailed status and progress information.
- -x
-
(Optional) Display detailed information about the progress and state of a Greengage DB system expansion.
- -l <log_directory>
-
(Optional) The directory to write the log file. Defaults to ~/gpAdminLogs.
- -? | -h | --help
-
Display help.
Output field definitions
The following output fields are reported by gpstate -s for the master.
| Output data | Description |
|---|---|
Master host |
Host name of the master |
Master postgres process ID |
PID of the master database listener process |
Master data directory |
File system location of the master data directory |
Master port |
Port of the master |
Master current role |
|
Greengage DB array configuration type |
|
Greengage initsystem version |
Version of Greengage DB when system was first initialized |
Greengage current version |
Current version of Greengage DB |
Postgres version |
Version of PostgreSQL that Greengage DB is based on |
Master standby |
Host name of the standby master |
Standby master state |
Status of the standby master: |
The following output fields are reported by gpstate -s for each primary segment.
| Output data | Description |
|---|---|
Hostname |
System-configured host name |
Address |
Network address host name (NIC name) |
Datadir |
File system location of segment data directory |
Port |
Port number of segment |
Current role |
Current role of a segment: |
Preferred role |
Role at system initialization time: |
Mirror status |
Status of a primary/mirror segment pair:
|
Current write location |
Location where primary segment is writing new logs as they come in |
Bytes remaining to send to mirror |
Bytes remaining to be sent from primary to mirror |
PID |
Active process ID of a segment |
Configuration reports status as |
Segment status as reported in the system catalog: |
Database status |
Status of Greengage DB to incoming requests: |
The following output fields are reported by gpstate -s for each mirror segment.
| Output data | Description |
|---|---|
Hostname |
System-configured host name |
Address |
Network address host name (NIC name) |
Datadir |
File system location of segment data directory |
Port |
Port number of segment |
Current role |
Current role of a segment: |
Preferred role |
Role at system initialization time: |
Mirror status |
Status of a primary/mirror segment pair:
|
WAL Sent Location |
Log location up to which the primary segment has sent log data to the mirror |
WAL Flush Location |
Log location up to which the mirror segment has flushed the log data to disk |
WAL Replay Location |
Log location up to which the mirror segment has replayed logs locally |
Bytes received but remain to flush |
Difference between flush log location and sent log location |
Bytes received but remain to replay |
Difference between replay log location and sent log location |
PID |
Active process ID of a segment |
Configuration reports status as |
Segment status as reported in the system catalog: |
Database status |
Status of Greengage DB to incoming requests: |
When there is no connection between a primary segment and its mirror, gpstate -s displays Unknown in the following fields:
-
Bytes remaining to send to mirror -
WAL Sent Location -
WAL Flush Location -
WAL Replay Location -
Bytes received but remain to flush -
Bytes received but remain to replay
The following output fields are reported by gpstate -f for standby master replication status.
| Output data | Description |
|---|---|
Standby address |
Hostname of the standby master |
Standby data directory |
File system location of the standby master data directory |
Standby port |
Port of the standby master |
Standby PID |
Process ID of the standby master |
Standby status |
Status of the standby master: |
WAL Sender State |
Write-ahead log (WAL) streaming state: |
Sync state |
WAL sender synchronization state: |
Sent Location |
WAL sender transaction log (xlog) record sent location |
Flush Location |
WAL receiver xlog record flush location |
Replay Location |
Standby xlog record replay location |
Examples
Show detailed status information of a Greengage DB system:
$ gpstate -s
Do a quick check for down segments in the master host system catalog:
$ gpstate -Q
Show information about mirror segment instances:
$ gpstate -m
Show information about the standby master configuration:
$ gpstate -f
Display the Greengage DB software version information:
$ gpstate -i