'mariabackup --prepare': Cannot open config file, backup-my.cnf
I am testing mariabackup. I could successfully make a mariadb backup using mariabackup utility. As the manual said before restore (--copy-back), we should use '--prepare' option first.
Therefore, I executed the following statement:
# mariabackup --defaults-file=/etc/my.cnf.d/backup-my.cnf --prepare --target-dir=/backup/mariadb-backup-20181210182451
mariabackup based on MariaDB server 10.3.10-MariaDB Linux (x86_64)
mariabackup: cd to /backup/mariadb-backup-20181210182451/
cannot open backup-my.cnf for reading
It complained 'cannot open backup-my.cnf for reading'.
Then I tried the following:
# mariabackup --defaults-file="/etc/my.cnf.d/backup-my.cnf" --prepare --target-dir=/backup/mariadb-backup-20181210182451
Same error messages!
I have already created 'backup-my.cnf' under /etc/my.cnf.d
# cd /etc/my.cnf.d
# ll
[root@db1 my.cnf.d]# ll
total 16
-rw-r--r--. 1 root root 739 Dec 10 18:42 backup-my.cnf
-rw-r--r--. 1 root root 763 Oct 2 17:45 enable_encryption.preset
-rw-r--r--. 1 root root 232 Oct 2 17:45 mysql-clients.cnf
-rw-r--r--. 1 root root 1789 Dec 10 18:40 server.cnf
Why did mariabackup complain 'cannot open backup-my.cnf for reading'?
-
Here below are the backup files:
[root@ekycdb1 mariadb-backup-20181214213349]# ll
total 276
-rw-r-----. 1 root root 420 Dec 14 21:33 aria_log.00000001.qp
-rw-r-----. 1 root root 129 Dec 14 21:33 aria_log_control.qp
-rw-r-----. 1 root root 338 Dec 14 21:33 backup-my.cnf.qp
-rw-r-----. 1 root root 1115 Dec 14 21:33 ib_buffer_pool.qp
-rw-r-----. 1 root root 247322 Dec 14 21:33 ibdata1.qp
-rw-r-----. 1 root root 428 Dec 14 21:33 ib_logfile0.qp
-rw-r-----. 1 root root 101 Dec 14 21:33 xtrabackup_checkpoints
-rw-r-----. 1 root root 132 Dec 14 21:33 xtrabackup_galera_info.qp
-rw-r-----. 1 root root 496 Dec 14 21:33 xtrabackup_info.qpAs I used '--compress' to back up MariaDB, the db files were compressed. The backup-my.cnf file was backed up and compressed as 'backup-my.cnf.qp'. 'backup-my.cnf' does not exist.
As I am using 'root' to perform '--prepare' operation, file permission should not be an issue. Should I decompress the backup files first before doing any '--prepare' operation?
-
When I tried to perform --decompress, I got the following error:
# mariabackup --decompress --target-dir /tmp/backup/mariadb-backup-20181214213349
mariabackup based on MariaDB server 10.3.10-MariaDB Linux (x86_64)
181214 21:49:12 [01] decompressing ./ib_logfile0.qp
sh: qpress: command not found
cat: write error: Broken pipe
Error: thread 0 failed. -
Hi,
Yes, to prepare the backup it has to be decompressed. The issue you have is caused by the fact that you don't have qpress installed on your system. Please find some links I found that seem to be relevant to this case:
https://mariadb.com/kb/en/library/mariabackup-options/#-decompress
https://jira.mariadb.org/browse/MDEV-15069As per the jira, you can install qpress manually:
wget http://www.quicklz.com/qpress-11-linux-x64.tar
tar xf qpress-11-linux-x64.tar
sudo cp qpress /usr/bin/qpress
sudo chmod 755 /usr/bin/qpress
sudo chown root:root /usr/bin/qpress
Please sign in to leave a comment.
Comments
8 comments