Xtrabackup:
Advantages of Xtrabackup:
1. Fast, support parallel backup. --parallel=8
2. Online backup backup, do not block read/write (INNODB), add global lock to MyISAM
3. Support to build master-slave copy Online
Basic practical methods of Xtrabackup:
--Fully prepared
Innobackupex--defaults-file=/etc/my.cnf--user=root--socket=/var/lib/mysql/mysql.sock--parallel=8/home/backup/
/home/backup: Directory for full file storage
--Make the first incremental backup on the full backup directory
Innobackupex--user=root--socket=/var/lib/mysql/mysql.sock--defaults-file=/etc/my.cnf--parallel=8--incremental/ home/backup/--incremental-basedir=/home/backup/2014-06-22_20-10-49/
/home/backup: The stored directory for incremental backups
--INCREMENTAL-BASEDIR=/HOME/BACKUP/2014-06-22_20-10-49: Fully-prepared catalogue
--incremental backup on the basis of the last incremental backup
Innobackupex--user=root--socket=/var/lib/mysql/mysql.sock--defaults-file=/etc/my.cnf--parallel=8--incremental/ home/backup/--incremental-basedir=/home/backup/2014-06-22_20-23-18/
/home/backup: The storage directory for the second incremental backup
--incremental-basedir: Directory of the last incremental backup
Stop MySQL Service
Service MySQL Stop
Restore the database:
Consolidated Backup:
Innobackupex--apply-log--redo-only/home/backup/2014-06-22_20-10-49/
Merge the first backup into a full standby
Innobackupex--apply-log--redo-only--incremental/home/backup/2014-06-22_20-10-49/--incremental-dir=/home/backup /2014-06-22_20-23-01
Merging a second backup into full standby
Innobackupex--apply-log--incremental/home/backup/2014-06-22_20-10-49/--incremental-dir=/home/backup/2014-06-22 _20-23-18
Copy the fully-prepared file to the database directory (make sure the database directory is empty)
Innobackupex--defaults-file=/etc/my.cnf--user=root--copy-back/home/backup/2014-06-22_20-10-49/
Change Database directory permissions:
Chown mysql:mysql/var/lib/mysql/-R
Turn on MySQL service
Service MySQL Start
RELATED links:
Xtrabackup Principle of Backup
http://sofar.blog.51cto.com/353572/1313649
Parameter explanation:
Http://www.linuxidc.com/Linux/2014-01/95132.htm
Using Xtrabackup to build master-slave replication on large database online
http://navyaijm.blog.51cto.com/4647068/1422229
Xtrabackup for incremental backup and recovery
http://blog.csdn.net/justdb/article/details/17054667
This article is from the "SQL Server MySQL" blog, so be sure to keep this source http://dwchaoyue.blog.51cto.com/2826417/1429918