Because the xtrabackup version installed on the server is relatively old and does not support hot backup of mysql 5.7, you need to upgrade the version or deploy version 2.4.1 on the new server. Here we download the latest https://www.percona.com/downloads/XtraBackup/ 2.4.4 Tools, install and back up mysql 5.7.
1. Install XtraBackup. I will not explain it here. The previous article will introduce how to install it. The following describes common errors. For example, I have encountered two errors today:
Error: Failed dependencies:
Libev. so.4 () (64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64
Libnuma. so.1 () (64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64
(1) libev. so.4 () (64bit) is needed by percona-xtrabackup-24-2.4.4-1 .. el6.x86 _ 64 solution:
Rpm-ivh ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm
Install the above rpm Package
(2) libnuma. so.1 () (64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64 solution:
Rpm-ivh http://mirror.centos.org/centos/6/ OS /x86_64/Packages/numactl-2.0.9-2.el6.x86_64.rpm
Install the above rpm package.
2. Back up mysql. Here we write a shell script for backup.
#! /Bin/bash
# Mysql full back
# Date 2016.10.18
# Author: 21 yunwei
Time = 'date + % F'
Logfile = "/data/bakup/mysql_full_bak_time.log"
Fullbakup_logfile = "/data/bakup/fullbakup_logfile.log"
Mysql_bakdir = "/data/bakup"
User = xxxxx
Password = xxxxxxx
[! -D $ mysql_bakdir] & amp; mkdir-p $ mysql_bakdir
[! -E $ logfile] & amp; touch $ logfile
[! -E $ fullbakup_logfile] & amp; touch $ fullbakup_logfile
Innobackupex -- defaults-file =/etc/my. cnf -- user = $ user -- password = $ passsword -- compress $ {mysql_bakdir} 2 & gt; & amp; 1 & gt; $ fullbakup_logfile
Ret = $?
Finishtime = 'date + % Y % m % d _ % H % M % s'
[$ Ret-eq 0] & amp; echo "Mysql fullbakup finished, time: $ finishtime" & gt; $ logfile | echo "Mysql fullbakup failed, please check time: $ finishtime "& gt; $ logfile