SQL Statements
SHOW NODES statement
Overview
The SHOW NODES
returns the current state of the cluster.
The
SHOW NODES
statement is not case-sensitive. So, show nodes
, Show Nodes
, and SHOW NODES
all do the same thing.Example
To view the current cluster state, execute the following statement:
SHOW NODES;
You’ll see a table with information about each node in the cluster like this:
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 within the cluster.
-
name
: The name of the node. -
election_state
: The current state of the node (e.g., LEADER). Leader node oversees whole cluster. -
followers_count
: Number of nodes following the leader which applies to the leader node. -
connected_nodes_count
: Total nodes connected, including itself. -
degradation_error
: Shows an error message if the node is not working correctly; otherwise, it shows NULL.