Appearance
sys.cluster_status
Column Name | Data Type | Description |
---|---|---|
cluster_id | uuid | UUID for the cluster. |
is_online | boolean | Whether the cluster is online from a hardware resource perspective. |
is_ready | boolean | Whether the cluster is operationally ready from a worker node perspective. |
status | Cluster hardware status. | |
offline_reason | Reason why the cluster is offline. | |
state | text | Cluster state: RUNNING , SUSPENDED , and so on. |
Examples
Which clusters are currently running?
premdb=# select * from sys.cluster_status where state='RUNNING';
cluster_id | is_online | is_ready | status | offline_reason | state
--------------------------------------+-----------+----------+--------------+----------------+---------
da88c52f-c876-43f9-9777-6121e1b0da0e | t | t | NOT_DEGRADED | NOT_OFFLINE | RUNNING
7b942fdd-7293-47d6-86f4-de994daa300d | t | t | NOT_DEGRADED | NOT_OFFLINE | RUNNING
(2 rows)
Join sys.cluster
, sys.cluster_status
, and sys.worker
to add cluster names and worker roles to the information available in the status view:
premdb=# select c.cluster_id, c.status, c.offline_reason, c.state, w.role, cl.cluster_name
from sys.cluster_status c join sys.worker w on c.cluster_id=w.cluster_id
join sys.cluster cl on c.cluster_id=cl.cluster_id;
cluster_id | status | offline_reason | state | role | cluster_name
--------------------------------------+--------------+--------------------------+-----------+--------+-------------------------
da88c52f-c876-43f9-9777-6121e1b0da0e | NOT_DEGRADED | NOT_OFFLINE | RUNNING | MEMBER | cn-uat-beta1-cluster-01
7b942fdd-7293-47d6-86f4-de994daa300d | NOT_DEGRADED | TOO_MANY_MISSING_WORKERS | SUSPENDED | SPARE | bobr-may3-small-cluster
7b942fdd-7293-47d6-86f4-de994daa300d | NOT_DEGRADED | TOO_MANY_MISSING_WORKERS | SUSPENDED | SPARE | bobr-may3-small-cluster
(3 rows)