Backup mysql for xtrabackup with xbstream and lz4, xtrabackupxbstream

Source: Internet
Author: User

Backup mysql for xtrabackup with xbstream and lz4, xtrabackupxbstream

You need to temporarily add an instance for mysql. Using xtrabackup is the easiest and quickest.

On an existing data node:

/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

On the data node for temporary requisition:

Nc-l port | lz4-B7-d |/home/work/application/xtrabackup-2.2.3/xbstream-x


Restored after transfer

/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


The advantage of xbstream is that you can use the -- parallel = 8 parameter for parallel backup.

Lz4 is used to increase the compression and decompression speed. The following describes the installation process of lz4 in centos.

Wget -- content-dispositionHttps://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


Compression

Lz4-B4

Extract

Lz4-B7-d

Help Information

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

The result of backing up the mysql database with xtrabackup is only data, but there are still insert statements.

All the data backed up, including the insert
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.