View the running status of openGauss
Tags: opengauss
Published: 2023-03-28 03:18:51

Background Information
openGauss supports viewing the status of the entire openGauss, and confirms whether the running status of openGauss or a single host is normal through the query results.

prerequisite
openGauss has been started.

Steps
Log in to the active database node as the operating system user omm.

Use the following command to query the openGauss status:

gs_om -t status --detail
See Table 1 for parameter descriptions of openGauss status display results.

To query the instance status on a certain host, please add "-h" item to the command. Examples are as follows:

gs_om -t status -h plat2 
Among them, plat2 is the name of the host to be queried.

Parameter Description
Table 1  Node role description


field

field meaning

field value

cluster_state

openGauss status. showWhether the whole openGauss is running normally.

Normal: meansopenGauss is available, and the data has redundant backups. All processes are running, and the active-standby relationship is normal.
Unavailable: meansopenGauss is not available.
Degraded: meansopenGauss is available, but buggydatabase node,Database master node instance.
node

host name

Indicates the name of the host where the instance resides. When there are multiple AZs, the AZ number will be displayed.

node_ip

host IP

Indicates the host IP where the instance is located.

instance

Instance ID

Indicates the ID of the instance.

state

instance role

Normal: Indicates a single-host instance.
Primary: Indicates that the instance is the primary instance.
Standby: Indicates that the instance is a standby instance.
Cascade Standby: Indicates that the instance is a cascade standby instance.
Pending: Indicates that the instance is in the arbitration phase.
Unknown: Indicates that the instance status is unknown.
Down: Indicates that the instance is down.
Abnormal: Indicates that the node is in an abnormal state.
Manually stopped: Indicates that the node has been manually stopped.
Each role also has different states, such as startup, connection, etc., and the descriptions of each state are as follows:

Table 2  Description of node status


state

field meaning

Normal

Indicates that the node starts normally

Need repair

The current node needs to be repaired

Starting

Node is starting

Wait promotion

The node is waiting to be upgraded, for example, after the standby machine sends an upgrade request to the main machine, it is waiting for the main machine to respond

Promotion

The standby node is being upgraded to the status of the primary node

Demoting

The node is being degraded, such as the main machine is being degraded to the standby machine

building

The standby machine failed to start and needs to be rebuilt

catch up

The standby node is catching up with the primary node

Coredump

Node program crashes

Unknown

Node state is unknown

When a node appears in the Need repair state, it may be necessary to rebuild the node to restore it to normal. Typically, the reasons for node rebuilding are described as follows:

Table 3  Explanation of the reasons for node reconstruction


state

field meaning

Normal

Indicates that the node starts normally

WAL segment removed

The master log/WAL log does not exist, or the standby log is newer than the master log

Disconnect

The standby machine cannot connect to the main machine

Version not matched

The master and backup binary versions are inconsistent

Mode not matched

The active and standby roles do not match, for example, the two standby machines are interconnected

System id not matched

The system ids of the active and standby databases are inconsistent, and the system IDs of the active and standby databases must be consistent

Timeline not matched

Inconsistent log timelines

Unknown

other reasons

example
View detailed status information of openGauss, including instance status information.

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