xtrabackup增量备份恢复步骤
Posted Demonson
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xtrabackup增量备份恢复步骤相关的知识,希望对你有一定的参考价值。
官网
https://www.percona.com/doc/percona-xtrabackup/2.4/backup_scenarios/incremental_backup.html
备份目录
/data/backups/base --基础备份
/data/backups/inc1 --一级增量备份
/data/backups/inc2 --二级增量备份
备份
$ xtrabackup --backup --target-dir=/data/backups/base
backup_type = full-backuped
from_lsn = 0
to_lsn = 1626007
last_lsn = 1626007
compact = 0
recover_binlog_info = 1
$ xtrabackup --backup --target-dir=/data/backups/inc1 --incremental-basedir=/data/backups/base
backup_type = incremental
from_lsn = 1626007
to_lsn = 4124244
last_lsn = 4124244
compact = 0
recover_binlog_info = 1
$ xtrabackup --backup --target-dir=/data/backups/inc2 --incremental-basedir=/data/backups/inc1
backup_type = incremental
from_lsn = 4124244
to_lsn = 6938371
last_lsn = 7110572
compact = 0
recover_binlog_info = 1
恢复
$ xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base
InnoDB: Shutdown completed; log sequence number 1626007
161011 12:41:04 completed OK!
$ xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base --incremental-dir=/data/backups/inc1
incremental backup from 1626007 is enabled.
xtrabackup: cd to /data/backups/base
xtrabackup: This target seems to be already prepared with --apply-log-only.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(4124244)
...
xtrabackup: page size for /tmp/backups/inc1/ibdata1.delta is 16384 bytes
Applying /tmp/backups/inc1/ibdata1.delta to ./ibdata1...
...
161011 12:45:56 completed OK!
$ xtrabackup --prepare --target-dir=/data/backups/base --incremental-dir=/data/backups/inc2
$ xtrabackup --copy-back --target-dir=/data/backups/base
以上是关于xtrabackup增量备份恢复步骤的主要内容,如果未能解决你的问题,请参考以下文章