標籤:sync apply 命令 目錄 sed man copy ack error
1.安裝依賴包 #yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL2. 安裝percona-xtrabackup工具 # rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm提示缺少依賴: 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 is needed by percona-xtrabackup-24-2.4.7-2.el6.x86_64安裝libnuma依賴包命令: #yum -y install numactl3.查看安裝目錄 # 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.建立專用備份賬戶 mysql> create user [email protected]‘localhost‘ identified by ‘123456‘;mysql> grant reload,PROCESS,lock tables,Replication client,super on *.* to [email protected]‘localhost‘;5.全備、增備及恢複 全備:#innobackupex --defaults-file=/etc/my.cnf --user=root --password=123456 /home/backup/full 全備恢複:innobackupex --apply-log /home/backup/full/2017-06-14_21-26-56 innobackupex --copy-back /home/backup/full/2017-06-14_21-26-56 增備:#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 增備恢複:第一步是在所有備份目錄下重做已提交的日誌: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第二步復原未完成的日誌:innobackupex --apply-log /home/backup/full/2017-06-14_21-26-56第三步拷貝:service mysql stop執行copy-back之前需要清空mysql的data目錄innobackupex --copy-back /home/backup/full/2017-06-14_21-26-56啟動之前注意data目錄的許可權問題service mysql start
mysql之 percona-xtrabackup 2.4.7安裝(熱備工具)