xtrabackup增量备份方案,备份恢复全过程记录(二)
mm.ibd.delta mm.ibd.meta t.ibd.delta t.ibd.meta
[root@Slave02 inno]# ll
total 88
-rw-r--r-- 1 root root 32768 Mar 27 14:38 mm.ibd.delta
-rw-r--r-- 1 root root 18 Mar 27 14:38 mm.ibd.meta
-rw-r--r-- 1 root root 32768 Mar 27 14:38 t.ibd.delta
-rw-r--r-- 1 root root 18 Mar 27 14:38 t.ibd.meta
[root@Slave02 inno]#
注:在增量备份目录下,数据文件都是以.delta结尾的。增量备份只备份上一次全量备份后被修改过的page,所以增量备份只暂用较少的空 间。增量备份可以在增量备份的基础上增量。增量备份目录每次都需修改的。比如第二次增量就改成/data/back_up/delta2/)
备份恢复过程,对增量和全量各种一次prepare即可;
全量的prepare;
[root@Slave02 delta]# xtrabackup_55 --defaults-file=/etc/my.cnf --prepare --target-dir=/data/back_up
xtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined)
xtrabackup: cd to /data/back_up
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(893330211)
xtrabackup: Temporary instance for recovery is set as followings.
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
130327 14:40:53 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
130327 14:40:53 InnoDB: The InnoDB memory heap is disabled
130327 14:40:53 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
130327 14:40:53 InnoDB: Compressed tables use zlib 1.2.3
130327 14:40:53 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
130327 14:40:53 InnoDB: Initializing buffer pool, size = 100.0M
130327 14:40:53 InnoDB: Completed initialization of buffer pool
130327 14:40:53 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130327 14:40:53 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 1747, file name ./mysql-bin.000004
130327 14:40:54 InnoDB: Waiting for the background threads to start
130327 14:40:55 InnoDB: 1.1.5 started; log sequence number 893330211
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 1747, file name ./mysql-bin.000004
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
130327 14:40:55 InnoDB: Starting shutdown...
130327 14:40:56 InnoDB: Shutdown completed; log sequence number 893330449
[root@Slave02 delta]#
增量的prepare;
[root@Slave02 delta]# xtrabackup_55 --defaults-file=/etc/my.cnf --prepare --target-dir=/data/back_up --incremental-dir=/data/back_up/delta/
xtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined)
incremental backup from 893330211 is enabled.
xtrabackup: cd to /data/back_up
xtrabackup: This target seems to be a