目前我正在研究 Percona 的 xtrabackup。在“在复制环境中进行备份”段落中的手册中,它说--safe-slave-backup
始终建议使用该选项,我理解其背后的原因。
我现在只是想知道,当我不使用此选项时,结果是否真的有所不同。在备份上应用日志后,我不明白为什么使用或不使用此选项进行的备份会有区别。
我在问,因为在我们的生产环境中我们不使用这个选项。备份在午夜运行,但今晚失败了。备份是在从服务器上进行的,我对现在停止 SQL 线程来进行备份有一种不好的感觉。
目前我正在研究 Percona 的 xtrabackup。在“在复制环境中进行备份”段落中的手册中,它说--safe-slave-backup
始终建议使用该选项,我理解其背后的原因。
我现在只是想知道,当我不使用此选项时,结果是否真的有所不同。在备份上应用日志后,我不明白为什么使用或不使用此选项进行的备份会有区别。
我在问,因为在我们的生产环境中我们不使用这个选项。备份在午夜运行,但今晚失败了。备份是在从服务器上进行的,我对现在停止 SQL 线程来进行备份有一种不好的感觉。
我试图弄清楚为什么在我的 xtrabackup 文件上应用日志不起作用。
我创建了一个运行 MySQL 5.5.24 的 VM。然后我创建了 sakila 测试数据库并使用以下命令对其进行备份:
innobackupex --user=bckuser --password=XXXX --no-timestamp --compress /var/lib/mysql/dumps/backup/;
这成功地完成了。之后我想用这个命令应用日志:
innobackupex --user=bckuser --password=XXXX --apply-log /var/lib/mysql/dumps/backup/;
但我收到以下错误:
140912 21:46:19 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/var/lib/mysql/dumps/backup/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/var/lib/mysql/dumps/backup --tmpdir=/tmp
xtrabackup_55 version 2.1.9 for Percona Server 5.5.35 Linux (x86_64) (revision id: 746)
xtrabackup: cd to /var/lib/mysql/dumps/backup
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(8564748)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
140912 21:46:19 InnoDB: The InnoDB memory heap is disabled
140912 21:46:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140912 21:46:19 InnoDB: Compressed tables use zlib 1.2.3
140912 21:46:19 InnoDB: Initializing buffer pool, size = 100.0M
140912 21:46:19 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
140912 21:46:19 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140912 21:46:20 InnoDB: Error: all log files must be created at the same time.
140912 21:46:20 InnoDB: All log files must be created also in database creation.
140912 21:46:20 InnoDB: If you want bigger or smaller log files, shut down the
140912 21:46:20 InnoDB: database and make sure there were no errors in shutdown.
140912 21:46:20 InnoDB: Then delete the existing log files. Edit the .cnf file
140912 21:46:20 InnoDB: and start the database again.
xtrabackup: innodb_init(): Error occured.
innobackupex: Error:
innobackupex: ibbackup failed at /usr/bin/innobackupex line 2560.
我用谷歌搜索了很多,但我无法找出问题所在。你们有什么想法吗?