--------------------------安装
yum install -y https://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
sudo yum install percona-xtrabackup-22.x86_64
sudo yum install qpress.x86_64
---------------------------------使用xbstream流备份:
$ innobackupex --stream=xbstream /root/backup/ > /root/backup/backup.xbstream
使用流压缩:
$ innobackupex --stream=xbstream --compress /root/backup/ > /root/backup/backup.xbstream
----------------------------------restore
xbstream -x < xxxxxx.xbstream -C ./restore
cd restore
-----解压
for f in `find ./ -iname "*\.qp"`; do qpress -dT2 $f $(dirname $f) && rm -f $f; done
继续执行
innobackupex --decompress --parallel=32 ./
-----
innobackupex --defaults-file=/etc/mysql/xxx.cnf --user=xxx --password=xxx --apply-log ./restore/
innobackupex --defaults-file=/etc/mysql/xxx.cnf --user=xxx --password=xxx --copy-back ./restore/
chown mysql.mysql /home/tb/data
接下来 启动mysql服务吧 ~~~