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:

Here we assume that we have one node (node1) running, started with galera_new_cluster. All other nodes are stopped. And MaxScales stopped

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. {code} find /var/lib/mysql -type f -not -path "/var/lib/mysql/example/*" -delete {code} 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. {code} chown -R myid:mygroup /var/lib/mysql/ {code} Stop running node (node1) {code} systemctl stop mariadb {code} Start screens as user root for the scp’s on that node (node1) which was running Galera. You may want to utilise 4 terminals. {code} screen -S fornode2 screen -S fornode3 screen -S fornode4 screen -S fornode5 screen -S fornode6 (for possible existing slave) {code} And on every screen: {code} scp -pr /var/lib/mysql/* myid@node2IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node2 {code} {code} scp -pr /var/lib/mysql/* myid@node3IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node3 {code} {code} scp -pr /var/lib/mysql/* myid@node4IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node4 {code} {code} scp -pr /var/lib/mysql/* myid@node5IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node5 {code} {code} scp -pr /var/lib/mysql/* myid@node6IP:/var/lib/mysql/ && touch /tmp/scp_transfer_done_node6 {code} Wait until scp’s are finished. (watch -n 30 -d /tmp/)

Clear logs on node 2-5 if writing logs to /var/lib/mysql. Also on slave if existing {code} :> /var/lib/mysql/mariadb.err /var/lib/mysql/slow-queries.log {code} Set permissions back for mysql on nodes 2-5, also on slave if existing {code} chown -R mysql:mysql /var/lib/mysql/ {code} Bootstrap Galera Cluster from node (node1) {code} galera_new_cluster & tail -f /var/lib/mysql/mariadb.err {code} Start other nodes (2-5) one-by-one. Wait that node has joined to the cluster with IST before proceeding to start next node. {code} systemctl start mariadb & tail -f /var/lib/mysql/mariadb.err {code} Start MaxScales 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.