Galera
Feb 6, 2019To periodically check status of the cluster, create a script (/tmp/xx
):
#!/bin/sh
mysql --defaults-file=/path/to/.my.cnf -s -e "SHOW GLOBAL STATUS WHERE Variable_name IN ('wsrep_ready', 'wsrep_cluster_size', 'wsrep_cluster_status', 'wsrep_connected');"
And run it with:
watch sh /tmp/xx
If single node alive (ERROR 1047 WSREP has not yet prepared node for application use):
SET GLOBAL wsrep_provider_options='pc.bootstrap=YES';
This node can be used now has the new master so others nodes can recover from it.
grastate.dat
Try to recover from the node with max seqno
, for example this is a node that shows a graceful shutdown:
version: 2.1
uuid: cbd332a9-f617-11e2-b77d-3ee9fa637069
seqno: 43760
This grastate.dat
file shows -1
in the seqno
. This node crashed during transaction processing:
version: 2.1
uuid: cbd332a9-f617-11e2-b77d-3ee9fa637069
seqno: -1
This node crashed during DDL:
version: 2.1
uuid: 00000000-0000-0000-0000-000000000000
seqno: -1