Wednesday, August 16, 2017

Procedure to Stop and Start MariaDB Galera cluster

Procedure to Stop and Start MariaDB Galera cluster  

a. Determine which MariaDB instance (cw01-03) is the most advanced node state ID (ie. largest seqno value) & start this node first
i. For each node in the Galera cluster (cw01-03), get the value of the attribute seqno in the file /var/lib/mysql/grastate.dat
ii. If no file has seqno>0
1. For each node in the Galera cluster run the following command (as root) to get the last valid sequence:
#  mysqld_safe --wsrep-recover
2. Locate the value of the parameter seqno in the output
iii. Determine the node with the largest seqno value

b. Start/bootstrap the ‘mysql’ service with the most advanced state (ie. largest seqno value)
#  Log onto CW0?
#  mv /etc/init.d/mysql.ORIG  /etc/init.d/mysql
#  service  mysql  bootstrap

c. Start the ‘mysql’ service for the other 2 CWs
#  Log onto CW0?
#  mv /etc/init.d/mysql.ORIG  /etc/init.d/mysql
#  service  mysql  start
#
#  Log onto CW0?
#  mv /etc/init.d/mysql.ORIG  /etc/init.d/mysql
#  service mysql  start

No comments: