After a Crash:

  1. Login to all of the database servers
  2. Check which server has the most up to date database information (highest seqno) in the grastate.dat file
    • cat /var/lib/mysql/grastate.dat
  3. On the server with the highest seqno, determine the last committed transaction, and place the InnoDB tablespace into a consistent state
    • mysqld –wsrep-recover
  4. On the server with the highest seqno, change the ‘safe_to_bootstrap: 0’ value to ‘safe_to_bootstrap: 1’.
    • vim /var/lib/mysql/grastate.dat
  5. On the same server bootstrap the new cluster
    • galera_new_cluster
  6. Start MySQL on the other servers
    • service mysql start
  7. In MySQL check how many servers are in the current cluster
    • show global status like ‘wsrep_%’;

New Cluster won’t start

  1. Verify selinux or apparmor (ubuntu) is disabled
    • ln -ss /etc/apparmor.d/usr /etc/apparmor.d/disable/.sbin.mysqld
    • service apparmor status
  2. Verify mysql owns /var/lib/mysql recursively
    • chown mysql:mysql /var/lib/mysql -R
  3. If error log identifies something about “in the future”
    • mv ibdata1 ibdata1.bak
    • mv ib_logfile0 ib_logfile0.bak
    • mv ib_logfile1 ib_logfile1.bak

Leave a Reply

Your email address will not be published. Required fields are marked *