Querying Status
Background
GaussDB KernelopenGauss allows you to view the status of the entire GaussDB KernelopenGauss. The query result shows whether openGaussthe database or a single host is running properly.
Prerequisites
openGaussThe database has started.
Procedure
Log in as the OS user omm to the primary node of the database.
Run the following command to query openGaussthe database status:
gs_om -t status --detail
Table 1 describes parameters in the query result.
To query the instance status on a host, add -h to the command. For example:
gs_om -t status -h plat2
plat2 indicates the name of the host to be queried.
Parameter Description
Table 1 Node role description
Each role has different states, such as startup and connection. The states are described as follows:
Table 2 Node state description
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
Examples
View openGaussthe database status details, including instance status.
gs_om -t status --detail
[ Cluster State ]
cluster_state : Normal
redistributing : No
current_az : AZ_ALL
[ Datanode State ]
node node_ip instance state | node node_ip instance state
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 pekpopgsci00235 10.244.62.204 6001 /opt/gaussdb/cluster/data/dn1 P Primary Normal | 2 pekpopgsci00238 10.244.61.81 6002 /opt/gaussdb/cluster/data/dn1 S Standby Normal
gs_om -t status --detail
[ CMServer State ]
node node_ip instance state
--------------------------------------------------------------------------
1 host40 10.243.40.20 1 /usr1/cm_gauss/cluster/cm/cm_server Primary
2 host39 10.243.39.8 2 /usr1/cm_gauss/cluster/cm/cm_server Standby
3 host15 10.243.15.65 3 /usr1/cm_gauss/cluster/cm/cm_server Standby
[ ETCD State ]
node node_ip instance state
------------------------------------------------------------------------
1 host40 10.243.40.20 7001 /usr1/cm_gauss/cluster/etcd StateFollower
2 host39 10.243.39.8 7002 /usr1/cm_gauss/cluster/etcd StateFollower
3 host15 10.243.15.65 7003 /usr1/cm_gauss/cluster/etcd StateLeader
[ Cluster State ]
cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL
[ Datanode State ]
node node_ip instance state | node node_ip instance state | node node_ip instance state
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 host40 10.243.40.20 6001 /usr1/cm_gauss/cluster/dn1 P Primary Normal | 2 host39 10.243.39.8 6002 /usr1/cm_gauss/cluster/dn1 S Standby Normal | 3 host15 10.243.15.65 6003 /usr1/cm_gauss/cluster/dn1 S Standby Normal