89427418 2016-11-30
Percona Server为 MySQL 数据库服务器进行了改进,在功能和性能上较 MySQL 有着很显著的提升。该版本提升了在高负载情况下的 InnoDB 的性能、为 DBA 提供一些非常有用的性能诊断工具;另外有更多的参数和命令来控制服务器行为。
Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品。
如果另外一个应用在使用yum,yum就会被占用锁定了
如果出现 the yum lock
解决办法:
rm -f yum.pid
一、Percona安装过程中可能会有些依赖包需要安装
Failed dependencies:
Percona-Server-client-57 is needed by Percona-Server-server-57-5.7.12-5.1.el7.x86_64
Percona-Server-shared-57 is needed by Percona-Server-client-57-5.7.12-5.1.
Percona-Server-shared-compat-57 is needed by Percona-Server-shared-57-5.7
mariadb-libs is obsoleted by Percona-Server-shared-compat-57-5.7.12-5.1.el7.x86_64
二、首先,卸载废弃的依赖包
yum remove mariadb*
三、然后依次安装
rpm -ivh Percona-Server-shared-compat-57-5.7.12-5.1.el7.x86_64.rpm rpm -ivh Percona-Server-shared-57-5.7.12-5.1.el7.x86_64.rpm rpm -ivh Percona-Server-client-57-5.7.12-5.1.el7.x86_64.rpm rpm -ivh Percona-Server-server-57-5.7.12-5.1.el7.x86_64.rpm
四、启动MySQL服务
service mysqld start
注意:Percona 5.7安装完默认会产生个随机的密码,存在日志中。这个问题曾困扰我一上午
cat /var/log/mysqld.log | grep "A temporary password" | awk -F " " '{print$11}'
查看方法:
如何解决Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
五、安装Xtrabackup
rpm -ivh percona-xtrabackup-24-2.4.3-1.el7.x86_64.rpm
可能会出现下面错误提示信息:
Failed dependencies:
libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.3-1.el7.x86_64
perl(DBD::mysql) is needed by percona-xtrabackup-24-2.4.3-1.el7.x86_64
(1)解决 perl(DBD::mysql) :
yum install -y perl-DBD-MySQL
(2)解决 libev.so.4()(64bit)
可以自行去rpmfind.net搜索系统所需要的rpm包进行下载安装
wget ftp://rpmfind.net/linux/dag/RedHat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm
OK,安装完成
六、使用Xtrabackup备份
innobackupex --user=root --password=Pengyuanzhi --socket=/var/lib/mysql/mysql.sock /root
(1)Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at - line 693.
.pm实际上是Perl的包,只需安装如下软件包即可:
yum -y install perl-Digest-MD5
大功告成:
更多XtraBackup相关教程见以下内容:
XtraBackup 的详细介绍:请点这里
XtraBackup 的下载地址:请点这里