MariaDB Galera Cluster Monitoring

http://galeracluster.com/documentation-webpages/monitoringthecluster.html#monitoring-cluster

To check cluster integrity, for each node complete the following steps:
  1. Check that the node is part of the cluster:
Each node in the cluster should provide the same value. If you find a node that carries a different cluster state UUID, that node is not connected to the cluster.
At Node 1

MariaDB [(none)]> show status like 'wsrep_cluster_state_uuid';
MariaDB [(none)]> show status like 'wsrep_cluster_state_uuid';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_state_uuid | e48cd2c2-ab6e-11e4-a8af-268a757dde7a |
+--------------------------+--------------------------------------+

1 row in set (0.00 sec)

Node 2 and Node 3 should return same UUID


  1. Check that the node belongs to the same component:
    show status like 'wsrep_cluster_conf_id';
    +-----------------------+-------+
    | Variable_name         | Value |
    +-----------------------+-------+
    | wsrep_cluster_conf_id | 4     |
    +-----------------------+-------+
    1 row in set (0.00 sec)
    
    Each node in the cluster should provide the same value. If you find a node that carries a different value, this indicates the cluster is partitioned. Once network connectivity is restored, the value will align itself with the others.
On the first node check cluster size:-


 > show status like 'wsrep_cluster_size';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 3     |
+--------------------+-------+

If the value equals the expected number of nodes in the cluster, all nodes are connected to the cluster.
Note

You only need to check the cluster size on one node.
Check primary cluster status
show status like 'wsrep_cluster_status';
+----------------------+---------+
| Variable_name        | Value   |
+----------------------+---------+
| wsrep_cluster_status | Primary |

The node should return a value of Primary. Other values indicate that the node is part of a nonoperational component. This can occur in cases of multiple membership changes and a loss of quorum or in the case of a split-brain condition.

  1. Check the node status:
    SHOW VARIABLES LIKE 'wsrep_ready';
    
    If the value is TRUE, the node can accept SQL load.
  2. If the wsrep_ready value is FALSE, check that the node is connected:
    SHOW VARIABLES LIKE 'wsrep_connected';
    
    If the value is OFF, the node has not connected to any of the cluster components. This may relate to misconfiguration. For instance, if the node uses invalid values forwsrep_cluster_address or wsrep_cluster_name.
    Check the error log for proper diagnostics.
  3. If the node is connected, but still cannot accept SQL load, check that the node is part of the Primary Component:
    SHOW VARIABLES LIKE 'wsrep_local_state_comment';
    
    If the the state comment is JoiningWaiting for SST, or Joined, the node is syncing with the cluster.

No comments:

Post a Comment