To temporarily add an instance to MySQL, the simplest and fastest to use Xtrabackup.
On the 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 a temporary requisition data node:
Nc-l Port | lz4-b7-d | /home/work/app/xtrabackup-2.2.3/xbstream-x
Restore after transmission is complete
/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]
The advantage of using Xbstream is that you can use the --parallel=8 parameter to back up in parallel
The purpose of using LZ4 is to increase the compression and decompression speed, the following is the installation process of LZ4 in the CentOS environment
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
Compression
Lz4-b4
Unzip
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
Backup MySQL for xtrabackup with Xbstream and LZ4