1. Install the dependency pack #yum-y install perl perl-devel libaio libaio-devel perl-time-hires perl-dbd-mysql2. Install Percona-xtrabackup tool # RPM-IVH percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm hint missing dependency: warning: Percona-xtrabackup-24-2.4.7-2.el6.x86_64.rpm:header V4 dsa/sha1 Signature, key ID cd2efd2a:NOKEYerror:Failed dependencies: libev.so.4 () (64bit) is needed by percona-xtrabackup-24-2.4.7-2.el6.x86_64 Libnuma.so.1 () (64bit) is needed by percona-xtrabackup-24-2.4.7-2.el6.x86_64 rsync are needed by Percona-xtrabackup-24-2.4.7-2.el6.x86_64 Install Libnuma dependent Package Command: #yum-y install numactl3. Viewing the installation directory # RPM-QL percona-xtrabackup-24/usr/bin/innobackupex/usr/bin/xbcloud/usr/bin/xbcloud_osenv/usr/bin/xbcrypt/usr/bin/ xbstream/usr/bin/xtrabackup/usr/share/doc/percona-xtrabackup-24-2.4.7/usr/share/doc/ percona-xtrabackup-24-2.4.7/copying/usr/share/man/man1/innobackupex.1.gz/usr/share/man/man1/xbcrypt.1.gz/usr/ Share/man/man1/xbstream.1.gz/usr/share/man/man1/xtraBackup.1.gz4. Creating a dedicated Backup account mysql> create user [email protected] ' localhost ' identified by ' 123456 ';mysql> Grant Reload,process,lock tables,replication client,super on * * to [email protected] ' localhost '; 5. Full provisioning, replenishment and recovery Full: #innobackupex --defaults-file=/etc/my.cnf --user=root --password=123456 / home/backup/full Full Standby recovery:innobackupex --apply-log /home/backup/full/2017-06-14_21-26-56 innobackupex --copy-back /home/backup/full/2017-06-14_21-26-56 Add: #innobackupex--defaults-file= /ETC/MY.CNF--user=root--password=123456--incremental-basedir=/home/backup/full/2017-06-14_21-26-56-- incremental/home/backup/incremental Recovery: The first step is to redo the committed log under all backup directories: innobackupex --apply-log -- redo-only /home/backup/full/2017-06-14_21-26-56innobackupex --apply-log --redo-only /home/ backup/full/2017-06-14_21-26-56--incremental-dir=/home/backup/incremental/2017-06-14_ 21-35-43 The second step to roll back the unfinished log: Innobackupex --apply-log /home/backup/full/2017-06-14_21-26-56 Third Step copy: service MySQL You need to empty the MySQL data directory before stop execution Copy-back innobackupex --copy-back /home/backup/full/2017-06-14_ 21-26-56 Note the permissions of the data directory before starting service MySQL start
MySQL percona-xtrabackup 2.4.7 installation (hot spare tool)