MySQL Backup--Xtrabackup远程备份和限速备份

使用xbstream 备份到远程服务器

##xbstream 备份到远程服务器
innobackupex \
--defaults-file="/export/servers/mysql/etc/my.cnf" \
--host="localhost" \
--port=3358 \
--user="backuper" \
--password="backup@123" \
--stream=xbstream "/export/mysql_backup/" \
| ssh root@10.0.0.2 \
"gzip ->/export/mysql_backup/mysql_backup.gz"


## 由于备份文件使用xbstream和gzip进行两次压缩,因此需要进行两次解压
## 第一次使用gzip解压备份
gzip -d mysql_backup.gz

##第二次使用xbstream解压gzip
xbstream -x < mysql_backup

 

使用tar备份到远程服务器

##tar备份到远程服务器
innobackupex \
--defaults-file="/export/servers/mysql/etc/my.cnf" \
--host="localhost" \
--port=3358 \
--user="backuper" \
--password="backup@123" \
--stream=tar "/export/mysql_backup/" \
| ssh root@10.0.0.2 \
"gzip ->/export/mysql_backup/mysql_backup.tar.gz"


##使用tar解压
tar -ixzvf mysql_backup.tar.gz

 

本地限速备份(使用PV限速)

## 备份到/export/mysql_backup/full
## 使用tar进行流备份,限速后再使用tar -x 解压
cd /export/mysql_backup/full

innobackupex \
--defaults-file="/export/servers/mysql/etc/my.cnf" \
--host="localhost" \
--port=3358 \
--user="backuper" \
--password="backup@123" \
--stream=tar \
"/export/mysql_backup/tmp/" |pv -q -L50m | tar -x 

 

转载于:https://www.cnblogs.com/gaogao67/p/10980642.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值