backup mysql for xtrabackup with xbstream and lz4

來源:互聯網
上載者:User

標籤:style   http   color   os   io   使用   ar   for   資料   

需要臨時為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}


[email protected]


使用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

backup mysql for xtrabackup with xbstream and lz4

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.