1.记录备份开始时,InnoDB存储引擎重做日志文件检查点的LSN
2.复制共享表空间文件以及独立共享表空间文件。
3.记录复制完表空间文件后,InnoDB存储引擎重做日志文件检查点的LSN。
4.复制在备份时产生的重做日志。
优点:
1.在线备份,不阻塞任何的SQL语句。
2.备份性能好,备份的实质是复制数据库文件和重做日志文件。
3.支持压缩备份,通过选项,可以支持不同级别的压缩。
下载地址:
https://www.percona.com/downloads/XtraBackup/LATEST/
[root@zstedu bin]# ./xtrabackup --version
xtrabackup: recognized server arguments:
./xtrabackup version 2.4.12 based on MySQL server 5.7.19 Linux (x86_64) (revision id: 170eb8c)
完全备份
xtrabackup: recognized server arguments:
xtrabackup: recognized client arguments: --backup=1 --socket=/tmp/mysql3306.sock --user=root --password
Enter password:
180708 21:30:53 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql3306.sock
Using server version 5.7.22-log
./xtrabackup version 2.4.12 based on MySQL server 5.7.19 Linux (x86_64) (revision id: 170eb8c)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /data/mysql/mysql3306/data/
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
InnoDB: Number of pools: 1
180708 21:30:53 >> log scanned up to (3466946626)
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID 62 for mysql/time_zone_transition, old maximum was 0
180708 21:30:54 [01] Copying ./ibdata1 to /data/soft/percona-xtrabackup-2.4.12-Linux-x86_64/bin/xtrabackup_backupfiles/ibdata1
180708 21:30:54 >> log scanned up to (3466946626) 记录了重做日志的位置,然后对备份的InnoDB存储引擎表的物理文件,即共享表空间和独立表空间进行copy操作
180708 21:30:55 >> log scanned up to (3466946626)
180708 21:30:56 >> log scanned up to (3466946626)
180708 21:30:57 >> log scanned up to (3466946626)
180708 21:30:59 >> log scanned up to (3466946626)
180708 21:31:00 >> log scanned up to (3466946626)
。。。。。。。。。。。。。。。。。。。。。。。。。
180708 21:35:13 Finished backing up non-InnoDB tables and files 180708 21:35:13 [00] Writing /data/backup/xtrabackup_binlog_info
180708 21:35:13 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): ‘3466946617‘ xtrabackup: Stopping log copying thread. .
180708 21:35:13 >> log scanned up to (3466946626)
180708 21:35:13 Executing UNLOCK TABLES
180708 21:35:13 All tables unlocked
180708 21:35:13 [00] Copying ib_buffer_pool to /data/backup/ib_buffer_pool
=========================================增量备份=========================================================================
(1)完全备份,指定备份目录:
(2)增量备份:
180708 21:38:21 Finished backing up non-InnoDB tables and files 180708 21:38:21 [00] Writing /data/backup/1/xtrabackup_binlog_info
180708 21:38:21 Executing UNLOCK TABLES
180708 21:38:21 All tables unlocked
180708 21:38:21 [00] Copying ib_buffer_pool to /data/backup/1/ib_buffer_pool
180708 21:38:21 [00] Writing /data/backup/1/xtrabackup_info
(3)prepare
(4)apply incremental backup:
原文:https://www.cnblogs.com/chinaops/p/9279882.html