The implementation principle of xtrabackup is similar to that of InnoDB Recovery.
Main features:
1. Online hot backup. InnoDB and MyISAM can be backed up. InnoDB mainly applies the recovery principle. MyISAM directly Copies files.
2. Supports stream backup. You can back up data to disks, tape, and reomot hosts. -Stream = tar./| SSH user @ remotehost cat ">"/backup/DIR/
3. Incremental backup is supported. You can use the LSN and basic Backup Directory for Incremental backup.
4. The master log and master position information on the slave can be recorded.
5. Support for simultaneous hot backup of multiple processes, and the stability of xtrabackup is quite good.
I can find many posts about the use of xtrabackup, But I mentioned that innobackupex is rarely used for Incremental backup.
Here we will introduce how to use innobackupex for Incremental Backup:
Version of xtrabackup: xtrabackup-1.6.tar.gz
Http:/www.percona.com/downloads/xtrabackup/xtrabackup-1.6/linux/binary/x86_64/
Backup and recovery steps:
# Step 1: Make a full backup
./Innobackupex-defaults-file =/tmp/mysqld. CNF-no-timestamp-socket =/tmp/MySQL. Sock-user = admin-Password = ADMIN $ backupdir/full
# Step 2: perform an incremental backup based on full backup
. /Innobackupex-defaults-file =/tmp/mysqld. CNF-no-timestamp-socket =/tmp/MySQL. sock-user = admin-Password = admin-incremental-basedir = $ backupdir/full/$ backupdir/INC1
# Step 3: Perform the second Incremental Backup Based on the full backup and the first Incremental Backup
. /Innobackupex-defaults-file =/tmp/mysqld. CNF-no-timestamp-socket =/tmp/MySQL. sock-user = admin-Password = admin-incremental-basedir = $ backupdir/INC1/$ backupdir/inc2
# Step 4: Restore full backup
./Innobackupex $ backupdir/full/-apply-Log
# Step 5: Restore the first Incremental Backup Based on the full backup
./Innobackupex $ backupdir/full/-incremental-Dir = $ backupdir/INC1/-apply-Log
# Step 6: Restore the second Incremental Backup Based on the full backup and the first Incremental Backup
./Innobackupex $ backupdir/full/-incremental-Dir = $ backupdir/inc2/-apply-Log
# Step 7: copy the recovered data to the corresponding directory as required by the configuration file
./Innobackupex-defaults-file =/tmp/mysqld2.cnf $ backupdir/full/-copy-back
tips:
http:/www.orczhou.com/index.php/2010/04/xtrabackup-tips/