mxstate

Displays the status of a running YMatrix database system.

1 Description

The mxstate utility retrieves status information about the database cluster.
It provides detailed insights into the operational state of a YMatrix database instance. Since a YMatrix database system consists of multiple PostgreSQL database instances (Segments) distributed across several machines, additional status information is essential for effective system management. The mxstate tool delivers this extended visibility, including:

  • Which Segment hosts are down?
  • Configuration details of Master and Segments (host, data directory, etc.).
  • Ports in use by the system.
  • Mapping from primary Segments to their corresponding mirror Segments.

2 Options

Option Description
-c or --db-cluster-id Specifies the target database cluster ID. Uses the default ID if omitted.
-s or --detailed-status Displays detailed status, including individual segment states.
-o or --from-etcd-only Shows component status read only from etcd.
-m or --list-mirrors Displays mirror segment information.
-Q or --quick-status Displays information from catalog tables.
-f or --show-standby-master-details Displays standby master information.
-i or --show-version Displays version information.
-q or --quiet Runs in quiet mode. Output is not displayed on screen but still written to log files.
-t or --timeout Sets the timeout threshold in seconds for reading status. Default is 60 seconds if not specified.
-h or --help Displays help information.

3 Output Field Definitions

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

Output Data Description
Master host Hostname of the Master node
Master postgres process ID Process ID of the Master's listener process
Master data directory Filesystem location of the Master data directory
Master port Port number used by the Master's postgres listener process
Master current role dispatch = normal operation mode, utility = maintenance mode
Greenplum initsystem version Greenplum Database version when the system was first initialized
Greenplum current version Current Greenplum Database version
Postgres version PostgreSQL version on which Greenplum Database is based
Greenplum mirroring status Physical mirroring enabled or disabled
Master standby Hostname of the Master standby node
Standby master state State of the standby master: active or passive

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

Output Data Description
Hostname Configured hostname of the system
Address Network address hostname (NIC name)
Datadir Filesystem location of the segment data directory
Port Port number of the segment's postgres listener process
Current Role Current role of the segment: Mirror or Primary
Preferred Role Role assigned at system initialization: Mirror or Primary
Mirror Status Status of the primary/mirror pair: Synchronized = data is up-to-date on both, Resynchronization = data is being copied between segments, Change Tracking = segment is down and changes are being tracked
PID Process ID of the segment
Configuration reports status as Status recorded in system catalogs: Up/Down
Database status Actual runtime status of the database: Up/Down

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

Output Data Description
Standby address Hostname of the standby master
Standby data dir Filesystem location of the standby master's data directory
Standby port Port number of the standby master's postgres listener process
Standby PID Process ID of the standby master
Standby status Status of the standby: Standby host passive
WAL Sender State Write-Ahead Log (WAL) streaming state: streaming, startup, backup, catchup
Sync state Synchronization state of WAL sender: sync
Sent Location WAL sender's transaction log (xlog) record send position
Flush Location WAL receiver's xlog record flush position
Replay Location Xlog record replay position on the standby

4 Examples

Display status of the default database cluster:

mxstate

Display detailed status of the default database cluster:

mxstate -s

#or

mxstate --detailed-status

Display version information of the default database cluster:

mxstate -i

#or

mxstate --show-version

Display mirror segment information:

mxstate -m

#or

mxstate --list-mirrors

Display standby master configuration information:

mxstate -f

#or

mxstate --show-standby-master-details

Note!
YMatrix 5 introduces a new database architecture. The mxstate tool is now used to view cluster status and is not compatible with gpstate. Use gpstate in earlier versions.

See Also: mxstart, mxstop