zoukankan      html  css  js  c++  java
  • backup mysql for xtrabackup with xbstream and lz4

    极品暂时mysql加入一个实例,采用xtrabackup最简单的速度。

    在现有数据节点上:

    /home/work/app/xtrabackup-2.2.3/innobackupex --ibbackup=/home/work/app/xtrabackup-2.2.3/xtrabackup --parallel=8 --defaults-file= ${BACKUP_CNF} --socket=${BACKUP_SOCK} --user={BACKUP_USER} --password=${BACKUP_PWD} ${BAK} --no-timestamp --stream=xbstream | lz4 -B4 | nc host port

    在暂时征用的数据节点上:

    nc -l port | lz4 -B7 -d | /home/work/app/xtrabackup-2.2.3/xbstream -x


    传输完毕后恢复之

    /home/work/app/xtrabackup-2.2.3/innobackupex --ibbackup=/home/work/app/xtrabackup-2.2.3/xtrabackup --parallel=8 --apply-log --use-memory=4G --defaults-file=${BACKUP_CNF}${BAK}


    tudou@b2c.xiaomi.com


    使用xbstream的优点是能够使用--parallel=8參数来并行备份

    使用lz4目的是提高压缩和解压速度。以下是lz4在centos环境下的安装过程

    wget --content-disposition  https://github.com/Cyan4973/lz4/archive/r122.tar.gz


    tar zxf lz4-r122.tar.gz


    cd lz4-r122/


    make -j 4


    make install PREFIX=/home/work/app/lz4-r122


    压缩

    lz4 -B4

    解压

    lz4 -B7 -d

    help信息

    lz4 -?

    Incorrect parameters

    Usage :

         lz4 [arg] [input] [output]


    input   : a filename

             with no FILE, or when FILE is - or stdin, read standard input

    Arguments :

    -1     : Fast compression (default)

    -9     : High compression

    -d     : decompression (default for .lz4 extension)

    -z     : force compression

    -f     : overwrite output without prompting

    -h/-H  : display help/long help and exit

    版权声明:本文博主原创文章,博客,未经同意不得转载。

  • 相关阅读:
    215. Kth Largest Element in an Array
    214. Shortest Palindrome
    213. House Robber II
    212. Word Search II
    210 Course ScheduleII
    209. Minimum Size Subarray Sum
    208. Implement Trie (Prefix Tree)
    207. Course Schedule
    206. Reverse Linked List
    sql 开发经验
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4884820.html
Copyright © 2011-2022 走看看