一:介绍

常用工具分别是/usr/local/xtrabackup/bin/innobackupex /usr/local/xtrabackup/bin/xtrabackup

1.特点

    开源数据库热备份软件
    备份过程中,不锁表,不中断事务
    备份快速,可靠
    自动校验备份数据

2.支持的linux系统发行版

            Debian:
            6.0 (squeeze)
            7.0 (wheezy)
            8.0 (jessie)
            Ubuntu:
            12.04LTS (precise) 
            14.04LTS (trusty) 
            14.10 (utopic)
            15.04 (vivid) 
            CentOS 5 and RHEL 5
            CentOS 6 and RHEL 6 (Current Stable) 1
            CentOS 7 and RHEL 7
            Amazon Linux AMI (works the same as CentOS 6)

二:多种安装方式

主意:RHEL/Centos 5 不支持rpm的远程方式安装,所以你第一步应该下载这个rpm包.

wget  https://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
rpm  -ivh  percona-release-0.1-3.noarch.rpm


1.安装xtrabackcp仓库yum源

yum  install   -y   https://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

检测这个rpm包是否可用

yum list | grep percona
percona-xtrabackup-20.x86_64                    2.0.8-587.rhel5
percona-xtrabackup-20-debuginfo.x86_64          2.0.8-587.rhel5
percona-xtrabackup-20-test.x86_64               2.0.8-587.rhel5
percona-xtrabackup-21.x86_64                    2.1.9-746.rhel5                   
percona-xtrabackup-21-debuginfo.x86_64          2.1.9-746.rhel5          
percona-xtrabackup-22.x86_64                    2.2.13-1.el5                    
percona-xtrabackup-22-debuginfo.x86_64          2.2.13-1.el5         
percona-xtrabackup-debuginfo.x86_64             2.3.2-1.el5
percona-xtrabackup-test.x86_64                  2.3.2-1.el5

安装xtrabackup

yum   install    percona-xtrabackup     -y

2.CentOS7环境下rpm包方式安装

wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.3.2/binary/redhat/7/x86_64/percona-xtrabackup-2.3.2-1.el7.x86_64.rpm
yum localinstall percona-xtrabackup-2.3.2-1.el7.x86_64.rpm   -y

3.源码安装

(1)Github上下载源码,切到2.3分支

$ git clone https://github.com/percona/percona-xtrabackup.git
$ cd percona-xtrabackup
$ git checkout 2.3

(2)安装开发包

$ yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf \
  bison libtool ncurses-devel libgcrypt-devel libev-devel libcurl-devel \
  vim-common

(3)在Linux系统上CMAKE编译

$ cmake -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF && make -j4

(4)开始安装,默认安装路径/usr/local/xtrabackup

$ make install

三.卸载xtrabackup

yum remove percona-xtrabackup   -y