Cloud

SHOW NODES

The SHOW NODES statement returns the current state of the cluster. Only the superuser can run this statement.

SHOW NODES is not case-sensitive. show nodes, Show Nodes, and SHOW NODES produce the same result.

Examples

To view the current cluster state, run:

SHOW NODES;

This returns a table with information about each node in the cluster:

     name      | election_state  | followers_count | connected_nodes_count | degradation_error
---------------+-----------------+-----------------+-----------------------+-------------------
 n_oxla_node_1 | LEADER_FOLLOWER |               0 |                     3 |
 n_oxla_node_3 | LEADER          |               3 |                     3 |
 n_oxla_node_2 | LEADER_FOLLOWER |               0 |                     3 |
(3 rows)

Each row represents the state of an individual node, where:

  • name: Name of the node.

  • election_state: Current state of the node (for example, LEADER).

  • followers_count: Number of nodes following the leader. Only meaningful for the leader node.

  • connected_nodes_count: Total number of connected nodes, including itself.

  • degradation_error: Error message if the node is not working correctly. Otherwise NULL.

SHOW NODES is equivalent to SELECT * FROM system.nodes. You can query the system.nodes table directly to filter or sort results using WHERE and ORDER BY clauses.

Related system virtual tables include system.queries (running queries) and system.execs (execution tasks).