Comments - Partial Backup and Restore with Mariabackup

2 years, 3 months ago aung oo

Hi,

When I try to prepare a full backup with --export option, I am seeing these errors. I am not sure why is it trying to access the data files from mysql directory instead of backup directory specified by --target-dir option.

/opt/myapp/current/opt/mysql/bin/mariabackup based on MariaDB server 10.3.8-MariaDB Linux (x86_64)
mariabackup: auto-enabling --innodb-file-per-table due to the --export option
mariabackup: cd to /opt/myapp/dbbackup/backups/20190115122445/base/
mariabackup: This target seems to be not prepared yet.
mariabackup: using the following InnoDB configuration for recovery:
mariabackup:   innodb_data_home_dir = .
mariabackup:   innodb_data_file_path = ibdata1:10M:autoextend
mariabackup:   innodb_log_group_home_dir = .
mariabackup: Starting InnoDB instance for recovery.
mariabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
2019-01-15 12:30:49 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-01-15 12:30:49 0 [Note] InnoDB: Uses event mutexes
2019-01-15 12:30:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-01-15 12:30:49 0 [Note] InnoDB: Number of pools: 1
2019-01-15 12:30:49 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-01-15 12:30:49 0 [Note] InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M
2019-01-15 12:30:49 0 [Note] InnoDB: Completed initialization of buffer pool
2019-01-15 12:30:49 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-01-15 12:30:49 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=28776373
Last binlog file , position 0
Prepare export : executing "/opt/myapp/app-1.1/opt/mariadb-Linux-x86_64-10.3.8/bin/mariabackup" --mysqld "--defaults-file=/opt/myapp/dbbackup/.my.currentbase/.my.cnf"  --defaults-extra-file=./backup-my.cnf --defaults-group-suffix= --datadir=. --innodb --innodb-fast-shutdown=0 --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=104857600 --console  --skip-log-error --bootstrap  < mariabackup_prepare_for_export.sql
2019-01-15 12:30:50 0 [Note] mysqld (mysqld 10.3.8-MariaDB-log) starting as process 2562 ...
2019-01-15 12:30:50 0 [Note] InnoDB: Using Linux native AIO
2019-01-15 12:30:50 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-01-15 12:30:50 0 [Note] InnoDB: Uses event mutexes
2019-01-15 12:30:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-01-15 12:30:50 0 [Note] InnoDB: Number of pools: 1
2019-01-15 12:30:50 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-01-15 12:30:50 0 [Note] InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M
2019-01-15 12:30:50 0 [Note] InnoDB: Completed initialization of buffer pool
2019-01-15 12:30:50 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-01-15 12:30:51 0 [ERROR] InnoDB: Unable to lock /opt/myapp/app-1.1/opt/mysql/data/ibdata1 error: 11
2019-01-15 12:30:51 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-01-15 12:30:51 0 [Note] InnoDB: Retrying to lock the first data file
2019-01-15 12:30:51 0 [ERROR] InnoDB: Unable to lock /opt/myapp/app-1.1/opt/mysql/data/ibdata1 error: 11
2019-01-15 12:30:51 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-01-15 12:30:51 0 [ERROR] InnoDB: Unable to lock /opt/myapp/app-1.1/opt/mysql/data/ibdata1 error: 11
2019-01-15 12:30:51 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-01-15 12:30:51 0 [ERROR] InnoDB: Unable to lock /opt/myapp/app-1.1/opt/mysql/data/ibdata1 error: 11

This is the command to prepare and export the backup.

/opt/myapp/app-1.1/opt/mysql/bin/mariabackup --defaults-file=/opt/myapp/dbbackup/.my.currentbase/.my.cnf --prepare --databases=quarantine --user=root --export --target-dir=/opt/myapp/dbbackup/backups/20190115122445/base
 
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.