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