需要下载安装boost1.59和xtrabackup2.4.22源码包,到root根目录
wget https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
wget https://github.com/percona/percona-xtrabackup/archive/refs/tags/percona-xtrabackup-2.4.22.tar.gz
- 需要boost1.59库
- gcc版本大于等于5.3
- 不能再源码根目录直接编译,需要新建build子目录再config编译
编译安装
yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs -y # boost的依赖
yum install cmake openssl-devel libaio libaio-devel automake autoconf bison libtool ncurses-devel libgcrypt-devel libev-devel libcurl-devel zlib-devel vim-common # xtrabackup的依赖
yum groupinstall 'Development Tools' # 开发工具集合
# 目录准备
tar xf percona-xtrabackup-percona-xtrabackup-2.4.22.tar.gz
mv percona-xtrabackup-percona-xtrabackup-2.4.22 xtrabackup-2.4.22
cd xtrabackup-2.4.22/
mkdir build
cd build
mkdir myboost
cp /root/boost_1_59_0.tar.gz myboost/
cmake -DWITH_BOOST=myboost -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF -B .. # 生成config文件
make -j4
make install # 默认安装目录 /usr/local/xtrabackup/