Xtrabackup tools to back up mysql 5.7 and common error solutions

Source: Internet
Author: User
Tags touch centos percona

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

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.