Use xtrabackup for incremental database backup

Source: Internet
Author: User

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.