Protecting MariaDB using mariabackup

with IBM Spectrum Protect


· spictera

Protecting MariaDB using mariabackup

with IBM Spectrum Protect

There are several ways to protect MariaDB databases, where we are going to focus on using the mariabackup tool.

1.Install the IBM Spectrum Protect Client API

# rpm -ivh gsk*.rpm

# rpm –ivh *api*.rpm

# dpkg -i gsk*.deb

# dpkg –i *api*.deb

# rpm -ivh spfs*.rpm

# rpm –ivh spictera*.rpm

# dpkg -i spfs*.deb

# dpkg –i spictera*.deb

# vi /opt/tivoli/tsm/client/api/bin64/dsm.sys



ERRORLOGNAME /var/log/dsmerror_spfs.log

# setpassword /etc/spfs/TSM.PWD <<< secret

# vi /etc/spfs/spfs.opt




OPTIONFILE /etc/spfs/dsm.opt

# mkdir /backup

# mount.spfs /backup

You are now ready to start using Spectrum Protect as a file system, storing and retrieving backup data of MariaDB

# mariadb-backup — backup — user=backup— password=secret — parallel=10 — stream=xbstream > /backup/

 It is also possible to use the command, if you want each database file to be separate

# mariabackup --user=backup --password=secretpwd \

-- parallel=6 --backup --target-dir=/backup/$(date +%Y-%m-%d.%H:%M:%S)

Incremental backup of MariaDB

# mariabackup --prepare --target-dir=/backup/2021-12-27.00:10:00 --incremental-dir=/backup/$(date +%Y-%m-%d.%H:%M:%S)

# cd /var/lib/mysql

# rm -rf *

Step 3: restore data files

# mbstream -x < /backup/

Or if you used the second example, than one can use

# mariabackup --copy-back --target-dir=/backup/201-12-27.00:10:00 --parallel=8

# mariabackup --prepare --target-dir=/var/lib/mysql

# chown -R mysql.mysql /var/lib/mysql

# systemctl start mariadb

# mbstream -x < “/backup/”





All Posts

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly