TASSTA Documentation Center TASSTA Documentation Center More products
Hide table of contents Hide details Search My account

Troubleshooting

In the event of an emergency shutdown or hard crash, all nodes will have safe_to_bootstrap set to 0. To check this, run the following command on both servers:

cat /var/lib/mysql/grastate.dat

If safe_to_bootstrap is 0 for both servers, proceed to check the InnoDB storage engine to determine which node committed the last transaction in the cluster.

mysqld_safe --wsrep-new-cluster

The output will be something like the following:

2016-11-18 01:42:15 36311 [Note] InnoDB: Database was not shutdown normally!
2016-11-18 01:42:15 36311 [Note] InnoDB: Starting crash recovery....
2016-11-18 01:42:16 36311 [Note] WSREP: Recovered position: 37bb872a-ad73-11e6-819f-f3b71d9c5ada:345628
2016-11-18 01:42:17 36311 [Note] /home/philips/git/mysql-wsrep-bugs-5.6/sql/mysqld: Shutdown complete

Notice the number 345628 after the UUID string on the "Recovered position" line. This is the transaction to watch. Pick the server where this number is highest, and edit that server’s grastate.dat file to set safe_to_bootstrap to 1.

After you have edited the file, run the following command to start the new cluster:

/etc/init.d/mysql bootstrap