完结【4-4】CentOS 6 MySQL 大数据备份方案之Percona XtraBackup 2.1
3.0 FAQ
3.1 可能报错1
Can't locate Time/HiRes.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 /home/mysql/admin/bin/percona-xtrabackup-2.1.9/innobackupex line 23.BEGIN failed--compilation aborted at /home/mysql/admin/bin/percona-xtrabackup-2.1.9/innobackupex line 23.
解决方案:
.pm实际上是Perl的包,只需安装perl-Time-HiRes即可:
[root@test-huanqiu percona-xtrabackup-2.1.9]# yum install -y perl-Time-HiRes
3.2 可能报错2
Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/webserver/mysql5.1.57/bin/mysqlhotcopy line 25. BEGIN failed--compilation aborted at /usr/local/webserver/mysql5.1.57/bin/mysqlhotcopy line 25.
报错原因:系统没有按安装DBI组件。
DBI(Database Interface)是perl连接数据库的接口。其是perl连接数据库的最优秀方法,他支持包括Orcal,Sybase,mysql,db2等绝大多数的数据库。
解决办法:
安装DBI组件(Can't locate DBI.pm in @INC-mysql接口)
或者单独装DBI、Data-ShowTable、DBD-mysql 三个组件
[root@test-huanqiu percona-xtrabackup-2.1.9]# yum -y install perl-DBD-MySQL
接着使用innobackupex命令测试是否正常
[root@test-huanqiu percona-xtrabackup-2.1.9]# innobackupex --helpOptions:--apply-logPrepare a backup in BACKUP-DIR by applying the transaction log filenamed "xtrabackup_logfile" located in the same directory. Also, create new transaction logs. The InnoDB configuration is read fromthe file "backup-my.cnf".--compactCreate a compact backup with all secondary index pages omitted. This option is passed directly to xtrabackup. See xtrabackup documentation for details.--compressThis option instructs xtrabackup to compress backup copies of InnoDB data files. It is passed directly to the xtrabackup child process. Try 'xtrabackup --help' for more details.
3.3 可能报错3
161130 05:56:48 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/usr/local/mysql/my.cnf;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /home/mysql/admin/bin/percona-xtrabackup-2.1.9/innobackupex line 2956.
解决办法:
[root@test-huanqiu ~]# yum -y install perl-DBD-MySQL.x86_64 ...... Package perl-DBD-MySQL-4.013-3.el6.x86_64 already installed and latest version //发现本机已经安装了[root@test-huanqiu ~]# rpm -qa|grep perl-DBD-MySQLperl-DBD-MySQL-4.013-3.el6.x86_64
发现本机已经安装了最新版的perl-DBD-MYSQL了,但是仍然报出上面的错误!! 莫慌~~继续下面的操作进行问题的解决
查看mysql.so依赖的lib库
[root@test-huanqiu ~]# ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so linux-vdso.so.1 => (0x00007ffd291fc000) libmysqlclient.so.16 => not found //这一项为通过检查,缺失libmysqlclient.so.16库导致libz.so.1 => /lib64/libz.so.1 (0x00007f78ff9de000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f78ff7a7000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f78ff58e000) libm.so.6 => /lib64/libm.so.6 (0x00007f78ff309000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f78ff09d000) libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f78fecb9000) libc.so.6 => /lib64/libc.so.6 (0x00007f78fe924000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f78fe721000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f78fe4dd000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f78fe1f5000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f78fdff1000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f78fddc5000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f78fdbc0000) /lib64/ld-linux-x86-64.so.2 (0x00007f78ffe1d000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f78fd9b5000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f78fd7b2000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f78fd597000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f78fd37a000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f78fd15a000)
以上结果说明缺少libmysqlclient.so.16这个二进制包,找个官方原版的mysql的libmysqlclient.so.16替换了即可!
[root@test-huanqiu~]# find / -name libmysqlclient.so.16 //查看本机并没有libmysqlclient.so.16库文件
查看mysql/lib下的libmysqlclinet.so库文件
[root@test-huanqiu~]# ll /usr/local/mysql/lib/total 234596 -rw-r--r--. 1 mysql mysql 19520800 Nov 29 12:27 libmysqlclient.a lrwxrwxrwx. 1 mysql mysql 16 Nov 29 12:34 libmysqlclient_r.a -> libmysqlclient.a lrwxrwxrwx. 1 mysql mysql 17 Nov 29 12:34 libmysqlclient_r.so -> libmysqlclient.so lrwxrwxrwx. 1 mysql mysql 20 Nov 29 12:34 libmysqlclient_r.so.18 -> libmysqlclient.so.18 lrwxrwxrwx. 1 mysql mysql 24 Nov 29 12:34 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0 lrwxrwxrwx. 1 mysql mysql 20 Nov 29 12:34 libmysqlclient.so -> libmysqlclient.so.18 lrwxrwxrwx. 1 mysql mysql 24 Nov 29 12:34 libmysqlclient.so.18 -> libmysqlclient.so.18.1.0 -rwxr-xr-x. 1 mysql mysql 8858235 Nov 29 12:27 libmysqlclient.so.18.1.0 -rw-r--r--. 1 mysql mysql 211822074 Nov 29 12:34 libmysqld.a -rw-r--r--. 1 mysql mysql 14270 Nov 29 12:27 libmysqlservices.a drwxr-xr-x. 3 mysql mysql 4096 Nov 29 12:34 plugin
将mysql/lib/libmysqlclient.so.18.1.0库文件拷贝到/lib64下,拷贝后命名为libmysqlclient.so.16
[root@test-huanqiu~]# cp /usr/local/mysql/lib/libmysqlclient.so.18.1.0 /lib64/libmysqlclient.so.16[root@test-huanqiu~]# cat /etc/ld.so.confinclude ld.so.conf.d/*.conf /usr/local/mysql/lib/ /lib64/ [root@test-huanqiu~]# ldconfig最后卸载perl-DBD-MySQL,并重新安装perl-DBD-MySQL [root@test-huanqiu~]# rpm -qa|grep perl-DBD-MySQLperl-DBD-MySQL-4.013-3.el6.x86_64 [root@test-huanqiu~]# rpm -e --nodeps perl-DBD-MySQL [root@test-huanqiu~]# rpm -qa|grep perl-DBD-MySQL[root@test-huanqiu~]# yum -y install perl-DBD-MySQL
待重新安装后,再次重新检查mysql.so依赖的lib库,发现已经都通过了
[root@test-huanqiu~]# ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so linux-vdso.so.1 => (0x00007ffe3669b000) libmysqlclient.so.16 => /usr/lib64/mysql/libmysqlclient.so.16 (0x00007f4af5c25000) libz.so.1 => /lib64/libz.so.1 (0x00007f4af5a0f000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f4af57d7000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f4af55be000) libm.so.6 => /lib64/libm.so.6 (0x00007f4af533a000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f4af50cd000) libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f4af4ce9000) libc.so.6 => /lib64/libc.so.6 (0x00007f4af4955000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f4af4751000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f4af450d000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f4af4226000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f4af4021000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f4af3df5000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f4af3bf1000) /lib64/ld-linux-x86-64.so.2 (0x00007f4af61d1000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f4af39e5000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f4af37e2000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f4af35c8000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4af33aa000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4af318b000)
3.4 可能报错4
sh: xtrabackup_56: command not foundinnobackupex: Error: no 'mysqld' group in MySQL options at /home/mysql/admin/bin/percona-xtrabackup-2.1.9/innobackupex line 4350.
有可能是percona-xtrabackup编译安装后,在编译目录的src下存在xtrabackup_innodb55,只需要其更名为xtrabackup_55,然后拷贝到上面的/home/mysql/admin/bin/percona-xtrabackup-2.1.9/下即可!
(完)
系列文章
【4-1】CentOS 6 MySQL 大数据备份方案之Percona XtraBackup 2.1
【4-2】CentOS 6 MySQL 大数据备份方案之Percona XtraBackup 2.1
【4-3】CentOS 6 MySQL 大数据备份方案之Percona XtraBackup 2.1
完结【4-4】CentOS 6 MySQL 大数据备份方案之Percona XtraBackup 2.1
- 点赞
- 收藏
- 关注作者
评论(0)