Sometimes it can be helpful to perform a "manual SST" when Galera's normal SSTs fail. This can be especially useful when the cluster's datadir
is very large, since a normal SST can take a long time to fail in that case.
A manual SST essentially consists of taking a backup of the donor, loading the backup on the joiner, and then manually editing the cluster state on the joiner node. This page will show how to perform this process with Percona XtraBackup.
innobackupex --version
MYSQL_BACKUP_DIR=/mysql_backup mkdir $MYSQL_BACKUP_DIR
innobackupex
. The --galera-info
option should also be provided, so that the node's cluster state is also backed up. DB_USER=sstuser DB_USER_PASS=password innobackupex --user=$DB_USER --password=$DB_USER_PASS --galera-info --no-timestamp $MYSQL_BACKUP_DIR
For example, on systemd systems, you can execute::
systemctl status mariadb
MYSQL_BACKUP_DIR=/mysql_backup mkdir $MYSQL_BACKUP_DIR
OS_USER=dba JOINER_HOST=dbserver2.mariadb.com rsync -av $MYSQL_BACKUP_DIR/* ${OS_USER}@${JOINER_HOST}:${MYSQL_BACKUP_DIR}
innobackupex --apply-log $MYSQL_BACKUP_DIR
grastate.dat
file. MYSQL_DATADIR=/var/lib/mysql cat $MYSQL_DATADIR/grastate.dat | grep version
For example, a very common version number is "2.1".
--xtrabackup_galera_info
file in the backup that was copied to the joiner node. cat $MYSQL_BACKUP_DIR/xtrabackup_galera_info
Example output:
d38587ce-246c-11e5-bcce-6bbd0831cc0f:1352215
This output is in the format:
uuid:seqno
grastate.dat
file in the backup directory of the joiner node. The Galera Cluster version ID, the cluster uuid, and the seqno from previous steps will be used to fill in the relevant fields. For example, with the example values from the last two steps, we could do:
sudo tee $MYSQL_BACKUP_DIR/grastate.dat <<EOF # GALERA saved state version: 2.1 uuid: d38587ce-246c-11e5-bcce-6bbd0831cc0f seqno: 1352215 safe_to_bootstrap: 0 EOF
datadir
on the joiner node. MYSQL_DATADIR=/var/lib/mysql rm -Rf $MYSQL_DATADIR/*
datadir
the on joiner node. cp -R $MYSQL_BACKUP_DIR/* $MYSQL_DATADIR/
datadir
are correct on the joiner node. chown -R mysql:mysql $MYSQL_DATADIR/
For example, on systemd systems, you can execute::
systemctl start mariadb
tail -f /var/log/mysql/mysqld.log
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/manual-sst-of-galera-cluster-node-with-percona-xtrabackup/