zoukankan      html  css  js  c++  java
  • 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 
  • 相关阅读:
    windows下载
    vue-element-admin改造步骤
    js处理url
    好用的工具
    数据库设计工具
    虚拟机使用
    Mac上编译C
    MAC系统配置
    SQL语法
    SSMP一次请求数据处理过程分析
  • 原文地址:https://www.cnblogs.com/gaogao67/p/10980642.html
Copyright © 2011-2022 走看看