17、xtrabackup 常用备份功能与选项

并行备份

> innobackupex -p123123 --parallel=8 /backup

节流备份

> innobackupex -p123123 --throttle=200 /backup

压缩备份

> innobackupex -p123123 --compress /backup
> innobackupex -p123123 --compress --compress-threads=8 /backup
> innobackupex -p123123 --parallel=8 --compress --compress-threads=8 /backup

# 解压
wget http://www.quicklz.com/qpress-11-linux-x64.tar

# ls
qpress
# mv qpress /usr/local/bin/

qpress -d test.qp ./
for bf in `find . -iname "*\.qp"`; do qpress -d $bf $(dirname $bf) && rm $bf; done
innobackupex --decompress /backup/2013-08-01_11-24-04/
innobackupex --parallel=4 --decompress 2017-04-11_11-50-31/

流备份

# tar格式流备份
innobackupex -p123123 --stream=tar /backup

innobackupex -p123123 --stream=tar /backup > /backup/back.tar
tar -ixvf /backup/back.tar

innobackupex -p123123 --stream=tar /backup | gzip > /backup/fullback.tar.gz

innobackupex -p123123 --stream=tar /tmp | ssh root@192.168.1.120 \ "cat - > /backup/bak.tar"

# 备份到远程主机
- [1] 免密登录
- [2] innobackupex -p123123 --stream=tar /tmp | ssh root@192.168.1.120 \ "cat - > /backup/bak.tar"
- [3] innobackupex -p123123 --stream=tar /tmp | ssh root@192.168.1.120 \ "gzip > /backup/dateFullBak.tar.gz";

# xbstream格式流备份
innobackupex -p123123 --stream=xbstream ./ > /backup/fullbak.xbstream
innobackupex -p123123 --stream=xbstream --compress ./ > /backup/fullbak.xbstream

xbstream -x < bakup.xbstream
xbstream -x -C /backup/zsythink/ < fullbak.xbstream

备份到远程主机
> innobackupex -p123123 --stream=xbstream --compress /tmp | ssh root@192.168.1.120 "xbstream -x -C /backup/datafull"
posted @ 2019-02-15 11:11  侃豺小哥  阅读(305)  评论(0编辑  收藏  举报