mxstate

Displays the status of the running YMatrix database system.

1 Description

mxstate is used to obtain database cluster status information.
The mxstate tool displays information about the running YMatrix DB instance. Since the YMatrix database system consists of multiple PostgreSQL database instances (Segments) across multiple machines, you may need to learn more about the YMatrix database system. The mxstate tool provides additional status information for the YMatrix database system, such as:

  • Which Segment host has been shut down?
  • Master and Segment configuration information (host, data directory, etc.).
  • The port used by the system.
  • Map of main segment to its corresponding mirror segment.

2 Parameter Options

Parameter name Description
-c or --db-cluster-id The ID of the target database cluster, if omitted, uses the default ID.
-s or --detailed-status Display detailed status information, including the status of each data node (segment)
-o or --from-etcd-only Show only the status of each component read from etcd
-m or --list-mirrors Display information about mirror segment
-Q or --quick-status Show information in the catalogue table
-e Display segment node information in an abnormal state
-f or --show-standby-master-details Show information about standby segment
-i or --show-version Show version information
-q or --quiet Run in silent mode. The command output is not displayed on the screen, but is still written to the log file.
-t or --timeout Specifies the timeout threshold (in seconds) for the read state to wait for stop. If not specified, the default timeout is 60 seconds.
-h or --help Show Help Information

3 Output field definition

The following output fields are reported by the host's mxstate -s:

Output data Description
Master host The host name of the master node
Master postgres process ID PID of the master database listening process
Master data directory File system location of the main data directory
Master port Port of postgres database listener process on the master node
Master current role dispatch = general operating mode, utility = maintenance mode
Greenplum initsystem version Greenplum database version when the system is initialized for the first time
Greenplum current version Greenplum database current version
Postgres version The PostgreSQL version of the Greenplum database based
Greenplum mirroring status Physical or mirrorless
Master standby Hostname of the primary node standby node
Standby master state Status of the primary node standby node: active or passive

The following output fields are reported by mxstate -s for each data node (Segment):

Output data Description
Hostname System configuration hostname
Address Network address hostname (NIC name)
Datadir File system location of data node data directory
Port The port number of the postgres database listener process for the data node
Current Role Current Role of the data node: Mirror or Primary
Preferred Role Role at system initialization: Mirror or Primary
Mirror Status Status of the main/mirror data node pair: Synchronized = The data on both is up to date, Resynchronization = The data is currently being copied from one to another, Change Tracking = The data node is stopping and the active data node is recording changes
PID Process ID of the data node
Configuration reports status as Data node status recorded in the system directory: Up/Down
Database status The current database real status: Up/Down

The following output fields are copied by mxstate -f for each primary node standby node (referred to as "standby node" in the table):

Output data Description
Standby address Hostname of the standby node
Standby data dir File system location of the data directory of the standby node
Standby port The port of the postgres database listener process for the standby node
Standby PID Process ID of the standby node
Standby status Standby host passive
WAL Sender State Write-pre-log (WAL) streaming status: streaming, startup, backup, catchup
Sync state WAL Sender Synchronization Status: sync
Sent Location WAL Sender Transaction Log (xlog) Records Send Location
Flush Location WAL Receiver xlog Record Flush Location
Replay Location Restore xlog record playback position

4 Examples

  • Display the default database cluster status:
    mxstate
  • Show details of the default database cluster:
    
    mxstate -s

or

mxstate --detailed-status

- Show the version of the default database cluster:
``` bash
mxstate -i

#or

mxstate --show-version
  • Show information about the mirror node:
    
    mxstate -m

or

mxstate --list-mirrors

- Display information about the primary node standby node configuration:
``` bash
mxstate -f

#or

mxstate --show-standby-master-details
  • Display segment node information in an abnormal state
    mxstate -e

    Includes the following status:

Status Node Information
double failure DEAD_WITH_MIRROR
Failover DEAD_MIRROR_DOWN, DEAD_PRIMARY_DOWN
Failover is finished, recovery is required OK_MIRROR_DOWN
replication NO_RESP
recovery ends, rebalance is required OK_MIRROR_IN_SYNC/OK_MIRROR_NOT_IN_SYNC
mirror Not synchronized OK_MIRROR_NOT_IN_SYNC

Notes!
YMatrix 6 deploys a new database schema, enables the mxstate tool to view cluster status information, and is incompatible with gpstate. Previous versions were available with the gpstate tool.

See also: mxstart, mxstop