mysql之 percona-xtrabackup 2.4.7安装(热备工具)
发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,准备:os是centos6.7,提前下载并上传 percona-xtrabackup 安装包,下载网址为: https://www.percona.com/downloads/XtraBackup/L
千家信息网最后更新 2025年02月01日mysql之 percona-xtrabackup 2.4.7安装(热备工具)准备:os是centos6.7,提前下载并上传 percona-xtrabackup 安装包,下载网址为: https://www.percona.com/downloads/XtraBackup/LATEST/
1.安装依赖包
[root@localhost xtrabackup]# yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL
Dependency Installed:
perl-DBI.x86_64 0:1.609-4.el6
Complete!
2. 安装 percona-xtrabackup 工具
2.1 -- 发现缺包
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
error: Failed dependencies:
libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
2.2 -- 配置本地yum源后,用 yum 发现依然找不到包,搜寻后,网友解决方法是 单独下载 libev-4.15-1.el6.rf.x86_64.rpm 包
2.3 -- 安装 libev-4.15-1.el6.rf.x86_64.rpm 包,过了。
[root@mysql01 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
error: Failed dependencies:
libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
2.4 -- libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64 ,依然解决不了,最后决定强行安装。(这个问题卡了两个小时,现在不能很好的解决,留到以后再看)
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm --nodeps --force
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing... ########################################### [100%]
1:percona-xtrabackup-24 ########################################### [100%]
3. 测试,查看 percona-xtrabackup 版本
[root@mysql01 ~]# innobackupex -v
innobackupex version 2.4.7 Linux (x86_64) (revision id: 6f7a799)
[root@mysql01 ~]# rpm -ql percona-xtrabackup-24
/usr/bin/innobackupex
/usr/bin/xbcloud
/usr/bin/xbcloud_osenv
/usr/bin/xbcrypt
/usr/bin/xbstream
/usr/bin/xtrabackup
说明:Xtrabackup有两个主要的工具:xtrabackup、innobackupex
a、xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表
b、innobackupex是一个perl脚本封装了xtrabackup。支持同时备份InnoDB和MyISAM引擎的表。
4. 测试全备数据库
[root@mysql01 ~]# innobackupex --user=root --password=oracle --port=3606 --socket=/var/lib/mysql/mysql.sock /xtrabackup/full/
170602 06:48:07 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
170602 06:48:07 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3606;mysql_socket=/var/lib/mysql/mysql.sock' as 'root' (using password: YES).
Failed to connect to MySQL server as DBD::mysql module is not installed at - line 1327.
170602 06:48:07 Connecting to MySQL server host: localhost, user: root, password: set, port: 3606, socket: /var/lib/mysql/mysql.sock
Using server version 5.6.25
innobackupex version 2.4.7 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 6f7a799)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql/
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Number of pools: 1
。。。。
170602 06:48:10 Executing UNLOCK TABLES
170602 06:48:10 All tables unlocked
170602 06:48:10 Backup created in directory '/xtrabackup/full/2017-06-02_06-48-07/'
170602 06:48:10 [00] Writing backup-my.cnf
170602 06:48:10 [00] ...done
170602 06:48:10 [00] Writing xtrabackup_info
170602 06:48:10 [00] ...done
xtrabackup: Transaction log of lsn (1626027) to (1626027) was copied.
170602 06:48:10 completed OK!
5. 检查备份
[root@mysql01 ~]# ll /xtrabackup/full/
total 4
drwxr-x---. 5 root root 4096 Jun 2 06:53 2017-06-02_06-53-37
说明:工具使用没有问题,成功!
1.安装依赖包
[root@localhost xtrabackup]# yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL
Dependency Installed:
perl-DBI.x86_64 0:1.609-4.el6
Complete!
2. 安装 percona-xtrabackup 工具
2.1 -- 发现缺包
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
error: Failed dependencies:
libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
2.2 -- 配置本地yum源后,用 yum 发现依然找不到包,搜寻后,网友解决方法是 单独下载 libev-4.15-1.el6.rf.x86_64.rpm 包
2.3 -- 安装 libev-4.15-1.el6.rf.x86_64.rpm 包,过了。
[root@mysql01 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
error: Failed dependencies:
libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64
2.4 -- libcurl.so.3()(64bit) is needed by percona-xtrabackup-24-2.4.7-1.el5.x86_64 ,依然解决不了,最后决定强行安装。(这个问题卡了两个小时,现在不能很好的解决,留到以后再看)
[root@mysql01 ~]# rpm -ivh percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm --nodeps --force
warning: percona-xtrabackup-24-2.4.7-1.el5.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing... ########################################### [100%]
1:percona-xtrabackup-24 ########################################### [100%]
3. 测试,查看 percona-xtrabackup 版本
[root@mysql01 ~]# innobackupex -v
innobackupex version 2.4.7 Linux (x86_64) (revision id: 6f7a799)
[root@mysql01 ~]# rpm -ql percona-xtrabackup-24
/usr/bin/innobackupex
/usr/bin/xbcloud
/usr/bin/xbcloud_osenv
/usr/bin/xbcrypt
/usr/bin/xbstream
/usr/bin/xtrabackup
说明:Xtrabackup有两个主要的工具:xtrabackup、innobackupex
a、xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表
b、innobackupex是一个perl脚本封装了xtrabackup。支持同时备份InnoDB和MyISAM引擎的表。
4. 测试全备数据库
[root@mysql01 ~]# innobackupex --user=root --password=oracle --port=3606 --socket=/var/lib/mysql/mysql.sock /xtrabackup/full/
170602 06:48:07 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
170602 06:48:07 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3606;mysql_socket=/var/lib/mysql/mysql.sock' as 'root' (using password: YES).
Failed to connect to MySQL server as DBD::mysql module is not installed at - line 1327.
170602 06:48:07 Connecting to MySQL server host: localhost, user: root, password: set, port: 3606, socket: /var/lib/mysql/mysql.sock
Using server version 5.6.25
innobackupex version 2.4.7 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 6f7a799)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql/
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Number of pools: 1
。。。。
170602 06:48:10 Executing UNLOCK TABLES
170602 06:48:10 All tables unlocked
170602 06:48:10 Backup created in directory '/xtrabackup/full/2017-06-02_06-48-07/'
170602 06:48:10 [00] Writing backup-my.cnf
170602 06:48:10 [00] ...done
170602 06:48:10 [00] Writing xtrabackup_info
170602 06:48:10 [00] ...done
xtrabackup: Transaction log of lsn (1626027) to (1626027) was copied.
170602 06:48:10 completed OK!
5. 检查备份
[root@mysql01 ~]# ll /xtrabackup/full/
total 4
drwxr-x---. 5 root root 4096 Jun 2 06:53 2017-06-02_06-53-37
说明:工具使用没有问题,成功!
备份
工具
数据
两个
数据表
问题
测试
成功
下载网址
同时
小时
引擎
数据库
方法
版本
网友
网址
脚本
全备
准备
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
智慧零售系统软件开发
网络安全和谐宣传
奉贤区led大屏服务器
sql数据库自启动已关闭
医院网络安全制度
青岛锐聘互联网科技可信吗
杭州丰巢互联网科技有限公司
国道数据库
数据库某个字段无法读取
江苏新能源网络技术批发价格
学校网络安全检查总结报告模板
网络安全是热门专业吗
手机自带的服务器在哪里
辽宁时代网络技术服务五星服务
黎明杀机连接不上rtm服务器
微信订阅号数据库
30岁学习软件开发
软件开发群说明
网上怎么找软件开发
hpe服务器h3c紫光
服务器和台式机的硬件考题
js 读取数据库数据
网络安全法的用户信息
数据库程序锁住怎么处理
互联网科技用于战争
软件开发企业所得税加计扣除
企业管理app软件开发
我的世界樱花小镇手机版服务器
网络安全系列法规问答
幼儿园网络安全教育教案中班