Comments - Manual SST of Galera Cluster Node With Mariabackup

3 years, 2 months ago Mika Hakala
This comment has the status of 'removed' and can only be seen by you.

I prefer to use pure scp, it is faster and no need to play with grastate.dat. Something like this:

  1. Here we assume that we have one node (node1) running, started with galera_new_cluster. All other nodes are stopped. And MaxScales stopped
  1. Perform this on all stopped nodes 2-5: Wipe datadirs on those stopped nodes (nodes 2-5), NOT on that running node! (node1). Also on slave if existing. find /var/lib/mysql -type f -not -path "/var/lib/mysql/example/*" -delete
  1. Perform this on all stopped nodes 2-5: Give permissions for your account to /var/lib/mysql. This is needed because root cannot scp files between the nodes. Use id <loginname> too see your group. Also on slave if existing.

chown -R myid:mygroup /var/lib/mysql/

  1. Stop running node (node1) systemctl stop mariadb
  1. Start screens as user root for the scp’s on that node (node1) which was running Galera. You may want to utilise 4 terminals. screen -S fornode2 screen -S fornode3 screen -S fornode4 screen -S fornode5 screen -S fornode6 (for possible existing slave)

scp -pr /var/lib/mysql/* myid@node2IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node2

scp -pr /var/lib/mysql/* myid@node3IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node3

scp -pr /var/lib/mysql/* myid@node4IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node4

scp -pr /var/lib/mysql/* myid@node5IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node5

scp -pr /var/lib/mysql/* myid@node6IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node6

  1. Wait until scp’s are finished. (watch -n 30 -d /tmp/)
  1. Clear logs on node 2-5 if writing logs to /var/lib/mysql. Also on slave if existing :> /var/lib/mysql/mariadb.err /var/lib/mysql/slow-queries.log
  1. Set permissions back for mysql on nodes 2-5, also on slave if existing chown -R mysql:mysql /var/lib/mysql/
  1. Bootstrap Galera Cluster from node (node1) galera_new_cluster & tail -f /var/lib/mysql/mariadb.err
  1. Start other nodes (2-5) one-by-one. Wait that node has joined to the cluster with IST before proceeding to start next node.

systemctl start mariadb & tail -f /var/lib/mysql/mariadb.err

  1. Start MaxScales
  2. Start replication
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.