Determining Cluster State

Connect to each MySQL node using a MySQL client and check its status.

$ mysql -h NODE_IP -u root -pPASSWORD -e 'SHOW STATUS LIKE "wsrep_cluster_status";'
| Variable_name        | Value   |
| wsrep_cluster_status | Primary |

If all nodes are in the Primary component, you have a healthy cluster. If some nodes are in a Non-primary component, those nodes are not able to join the cluster.

See how many nodes are in the cluster.

$ mysql -h NODE_IP -u root -pPASSWORD -e 'SHOW STATUS LIKE "wsrep_cluster_size";'
| Variable_name      | Value |
| wsrep_cluster_size | 3     |

If the value of wsrep_cluster_size is equal to the expected number of nodes, then all nodes have joined the cluster. Otherwise, check network connectivity between nodes and use monit status to identify any issues preventing nodes from starting.

For more information, see the official Galera documentation for Checking Cluster Integrity.

Create a pull request or raise an issue on the source for this page in GitHub