mysql之 percona-xtrabackup 2.4.7安裝(熱備工具)

來源:互聯網
上載者:User

標籤: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安裝(熱備工具)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.