https://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/
http://stackoverflow.com/questions/24127115/mariadb-galera-cluster-set-up-problems/41352131#41352131
In CentOS 7 you need to use the following to find the log:
systemctl status mariadb.service
Generally you'd see:
/var/lib/mysql/$HOSTNAME.err
Checking that for ERROR/Warning:
cat /var/lib/mysql/sql1.err | grep ERROR cat /var/lib/mysql/sql1.err | grep Warning
You might see this:
[Warning] WSREP: no nodes coming from prim view, prim not possible
Which means that no cluster primary node exists and it can't figure out if it should become primary.
Eventually you need to run:
service mysql start --wsrep-new-cluster
This is run on the node you want to become Primary.
If you need to figure that out, you can use:
mysqld_safe --wsrep-recover
to find the last position of that node.
When I ran the "start new cluster" command, I found this in the logs:
[ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .
So I used the following and then I was able to start that node with the "--wsrep-new-cluster" and the rest of the nodes get started as per usual "service mysql start":
sed -i 's/safe_to_bootstrap: 0/safe_to_bootstrap: 1/g' /var/lib/mysql/grastate.dat
1 Comment
Anonymous