mysql物理备份工具xtrabackup第一天----实战安装

###############IT--小哥原创,如有雷同,纯属抄袭#################

1、xtrabackup简介

Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时

不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品。
  Xtrabackup有两个主要的工具:xtrabackup、innobackupex
  (1)xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表
  (2)innobackupex-1.5.1则封装了xtrabackup,是一个脚本封装,所以能同时备份处理innodb和myisam,但在处理myisam时需要加一个读锁

官网:https://www.percona.com/

2、xtrabackup的安装

2.1 安装配置

配置数据存储的目录

[root@xiaoya ~]# cat /etc/my.cnf |grep datadir

datadir=/var/lib/mysql

2.2 xtrabackup之二进制安装

[root@xiaoya opt]#

wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.3.3/binary/redhat/6/x86_64/Percona-XtraBackup-2.3.3-r525ca7d-el6-x86_64-bundle.tar

[root@xiaoya opt]# tar xf Percona-XtraBackup-2.3.3-r525ca7d-el6-x86_64-bundle.tar

[root@xiaoya opt]# ls

percona-xtrabackup-2.3.3-1.el6.x86_64.rpm

Percona-XtraBackup-2.3.3-r525ca7d-el6-x86_64-bundle.tar

percona-xtrabackup-debuginfo-2.3.3-1.el6.x86_64.rpm

percona-xtrabackup-test-2.3.3-1.el6.x86_64.rpm

安装必须的libev.so库

地址:http://rpmfind.net/linux/rpm2html/search.php?query=libev.so.4()(64bit)

[root@xiaoya ~]#

wget ftp://rpmfind.net/linux/epel/6/x86_64/libev-4.03-3.el6.x86_64.rpm

[root@xiaoya ~]# rpm -ivh libev-4.03-3.el6.x86_64.rpm

warning: libev-4.03-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]

   1:libev                  ########################################### [100%]

[root@xiaoya ~]# rpm -qa libev

libev-4.03-3.el6.x86_64

[root@xiaoya opt]#  rpm -ivh percona-xtrabackup-2.3.3-1.el6.x86_64.rpm

Preparing...                ########################################### [100%]

   1:percona-xtrabackup     ########################################### [100%]

[root@xiaoya opt]#  rpm -ivh percona-xtrabackup-debuginfo-2.3.3-1.el6.x86_64.rpm

Preparing...                ########################################### [100%]

   1:percona-xtrabackup-debu########################################### [100%]

###############IT--小哥原创,如有雷同,纯属抄袭#################

###############IT--小哥原创,如有雷同,纯属抄袭#################

###############IT--小哥原创,如有雷同,纯属抄袭#################

2.3 xtrabackup之yum安装

2.3.1 Install the Percona repository

[root@xiaoya ~]# yum install

http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

2.3.2 Testing the repository

[root@xiaoya ~]# yum list | grep percona

……

percona-xtrabackup-22.x86_64                2.2.13-1.el6                percona-xtrabackup.x86_64                   2.3.3-1.el6                 percona-xtrabackup-20.x86_64                2.0.8-587.rhel6             percona-xtrabackup-20-debuginfo.x86_64      2.0.8-587.rhel6             percona-xtrabackup-20-test.x86_64           2.0.8-587.rhel6             percona-xtrabackup-21.x86_64                2.1.9-746.rhel6             percona-xtrabackup-21-debuginfo.x86_64                                2.1.9-746.rhel6             

percona-xtrabackup-22-debuginfo.x86_64                                   2.2.13-1.el6               

percona-xtrabackup-debuginfo.x86_64        2.3.3-1.el6                 percona-xtrabackup-test.x86_64                                            2.3.3-1.el6                

percona-xtrabackup-test-21.x86_64           2.1.9-746.rhel6             percona-xtrabackup-test-22.x86_64                                        2.2.13-1.el6               

……

2.3.3 Install the packages

[root@xiaoya ~]# yum install percona-xtrabackup-22

2.3.4 check tish packages

[root@xiaoya ~]# rpm -qa percona-xtrabackup-22

percona-xtrabackup-22-2.2.13-1.el6.x86_64

2.4 xtrabackup安装错误总结

2.4.1 xtrabackup安装错误

错误一:

报错如下:

[root@xiaoya opt]# rpm -ivh percona-xtrabackup-2.3.3-1.el6.x86_64.rpm

warning: percona-xtrabackup-2.3.3-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY

error: Failed dependencies:

         libev.so.4()(64bit) is needed by percona-xtrabackup-2.3.3-1.el6.x86_64

        perl(DBD::mysql) is needed by percona-xtrabackup-2.3.3-1.el6.x86_64

原因:

缺少安装必须的libev.so.4库。

缺少perl。

 

错误二:

报错如下:

[root@xiaoya opt]#  rpm -ivh percona-xtrabackup-test-2.3.3-1.el6.x86_64.rpm

error: Failed dependencies:

        /usr/bin/mysql is needed by percona-xtrabackup-test-2.3.3-1.el6.x86_64

解决:

ln -s /application/mysql/bin/mysql /usr/bin/mysql

export PATH=/application/mysql/bin:$PATH

###############IT--小哥原创,如有雷同,纯属抄袭#################

你可能感兴趣的:(mysql备份,xtrabackup,物理工具,实战安装)