Querying Status

Background

openGauss allows you to query the entire status. You can check whether the openGauss or a single host is running properly based on the query result.

Prerequisites

openGauss has started.

Procedure

  1. Log in as the OS user omm to the primary node of the database.

  2. Run the following command to query openGauss status.

    gs_om -t status --detail
    

    Table 1 describes parameters in the query result.

    To query the instance state on a host, add -h to the command. The following is an example:

    gs_om -t status -h plat2 
    

    plat2 indicates the name of the host to be queried.

Parameter Description

Table 1 Node role description

Column

Description

Column Value

cluster_state

openGauss status, which indicates whether the entire openGauss is running properly.

  • Normal: openGauss is available and the data has redundancy backup. All the processes are running and the primary-standby relationship is normal.
  • Unavailable: openGauss is unavailable.
  • Degraded: openGauss is available and faulty database nodes and primary database nodes exist.

node

Host name

Name of the host where the instance is located. If there are multiple AZs, the AZ ID of the host will be displayed.

node_ip

Host IP address

Specifies the IP address of a host where an instance is located.

instance

Instance ID

Specifies the instance ID.

state

Instance role

  • Normal: The instance a single host instance.
  • Primary: The instance is a primary instance.
  • Standby: The instance is the standby.
  • Cascade Standby: The instance is a cascaded standby instance.
  • Pending: The instance is in the quorum phase.
  • Unknown: The instance state is unknown.
  • Down: The instance is down.
  • Abnormal: The node is abnormal.
  • Manually stopped: The node has been manually stopped.

Each role has different states, such as startup and connection. The states are described as follows:

Table 2 Node states

State

Description

Normal

The node starts up normally.

Need repair

The node needs to be restored.

Starting

The node is starting up.

Wait promoting

The node is waiting for upgrade. For example, after the standby node sends an upgrade request to the primary node, the standby node is waiting for the response from the primary node.

Promoting

The standby node is being upgraded to the primary node.

Demoting

The node is being downgraded, for example, the primary node is being downgraded to the standby node.

Building

The standby node fails to be started and needs to be rebuilt.

Catchup

The standby node is catching up with the primary node.

Coredump

The node program breaks down.

Unknown

The node state is unknown.

If a node is in Need repair state, you need to rebuild the node to restore it. Generally, the reasons for rebuilding a node are as follows:

Table 3 Node rebuilding causes

State

Description

Normal

The node starts up normally.

WAL segment removed

WALs of the primary node do not exist, and logs of the standby node are later than those of the primary node.

Disconnect

The standby node cannot be connected to the primary node.

Version not matched

The binary versions of the primary and standby nodes are inconsistent.

Mode not matched

Nodes do not match the primary and standby roles. For example, two standby nodes are connected.

System id not matched

The database system IDs of the primary and standby nodes are inconsistent. The system IDs of the primary and standby nodes must be the same.

Timeline not matched

The log timelines are inconsistent.

Unknown

Other causes.

Examples

View openGauss status details, including instance states.

gs_om -t status --detail 
[   Cluster State   ] 
 
cluster_state   : Normal 
redistributing  : No 
current_az      : AZ_ALL 
 
[  Datanode State   ] 
node                           node_ip           port                           instance                                   state 
---------------------------------------------------------------------------------------------------------------- 
1  pekpopgsci00235  10.244.62.204    5432      6001 /opt/gaussdb/cluster/data/dn1   P Primary Normal 
2  pekpopgsci00238  10.244.61.81      5432      6002 /opt/gaussdb/cluster/data/dn1   S Standby Normal
Feedback
编组 3备份
    openGauss 2024-05-19 00:42:09
    cancel