Xtrabackup full backup incremental backup and recovery

Source: Internet
Author: User
Tags percona

One. Installation


1. Configure the Yum source

RPM-UHV http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm


2. Installation

Yum Install Xtrabackup-y

Second, modify the MySQL master configuration file my.cnf (set according to the parameters of the compilation installation, RPM installation can be omitted)

[mysqld]datadir=/data/mysqldbbasedir=/usr/local/mysql/

Third, start the backup

1. Full backup:

Innobackupex--defaults-file=/etc/my.cnf--socke=/data/mysqldb/mysql.mysql--user=root--password= "/data/mysql_ backup/

2. Incremental backup

Innobackupex--defaults-file=/etc/my.cnf--socke=/data/mysqldb/mysql.mysql--user=root--password= "-- incremental-basedir=/data/mysql_backup/2016-08-11_15-50-10/--incremental/data/mysql_backup/

--INCREMENTAL-BASEDIR specifies which global backup to make for incremental backups

--incremental Incremental Backup

Iv. Recovery Testing

1. Stop MySQL:

Service Mysqld Stop

2. Remove/data/mysqldb/(RPM installation please delete/var/lib/mysql)

3. Prepare for recovery, the files previously backed up cannot be recovered directly, there is a preparation process, similar to initialization, to prevent uncommitted transactions from appearing

Innobackupex--defaults-file=/etc/my.cnf--socke=/data/mysqldb/mysql.mysql--user=root--password= '--apply-log-- redo-only/data/mysql_backup/2016-08-11_15-50-10/
Innobackupex--defaults-file=/etc/my.cnf--socke=/data/mysqldb/mysql.mysql--user=root--password= '--apply-log-- redo-only/data/mysql_backup/2016-08-11_15-50-10/--incremental-dir=/data/mysql_backup/2016-08-11_15-52-03/

/data/mysql_backup/2016-08-11_15-50-10/Path to full backup

--incremental-dir specifying the path of an incremental backup

4. Perform a full recovery you can recover all data from incremental and full backups

Innobackupex--defaults-file=/etc/my.cnf--socke=/data/mysqldb/mysql.mysql--user=root--password= "--copy-back/ data/mysql_backup/2016-08-11_15-50-10/


Xtrabackup full backup incremental backup and recovery

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.