最近的MHA验证时,遭遇了DBD::MySQL::dr::imp_data_size unexpectedly这个错误。而DBD这个包已经是安装过了的。下面是这个问题的描述和解决方案。
1、故障描述
# masterha_check_repl --conf=/etc/app1.cnf
Mon Feb 16 19:56:29 2015 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon Feb 16 19:56:29 2015 - [info] Reading application default configuration from /etc/app1.cnf..
Mon Feb 16 19:56:29 2015 - [info] Reading server configuration from /etc/app1.cnf..
Mon Feb 16 19:56:29 2015 - [info] MHA::MasterMonitor version 0.56.
Had to create DBD::mysql::dr::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Had to create DBD::mysql::db::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln326] Undefined subroutine &DBD::mysql::db::_login called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql.pm line 140.
at /usr/lib/perl5/site_perl/5.8.8/MHA/Server.pm line 166
Had to create DBD::mysql::dr::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Had to create DBD::mysql::db::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln326] Undefined subroutine &DBD::mysql::db::_login called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql.pm line 140.
at /usr/lib/perl5/site_perl/5.8.8/MHA/Server.pm line 166
Had to create DBD::mysql::dr::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Had to create DBD::mysql::db::imp_data_size unexpectedly at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 1190.
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln326] Undefined subroutine &DBD::mysql::db::_login called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql.pm line 140.
at /usr/lib/perl5/site_perl/5.8.8/MHA/Server.pm line 166
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln326] Got fatal error, stopping operations
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln520] Error happened on checking configurations. at /usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm line 326
Mon Feb 16 19:56:29 2015 - [error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln691] Error happened on monitoring servers.
Mon Feb 16 19:56:29 2015 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
2、故障解决
###查看当前系统的dbi与dbd包,如下表明2个包都已安装
# rpm -qa|grep -i dbi
perl-DBI-1.52-2.el5
# rpm -qa|grep -i dbd
perl-DBD-Pg-1.49-4.el5_8
perl-DBD-MySQL-3.0007-2.el5
###我们首先卸载这2个rpm包
# rpm -e --nodeps perl-DBI-1.52-2.el5
# rpm -e --nodeps perl-DBD-MySQL-3.0007-2.el5
###下面使用yum方式分别安装这2个包
# yum install perl-DBI
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.cug.edu.cn
* epel: mirrors.ustc.edu.cn
* extras: mirrors.hust.edu.cn
* updates: mirrors.hust.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-DBI.x86_64 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================
Package Arch Version Repository Size
===================================================================================================
Installing:
perl-DBI x86_64 1.52-2.el5 base 600 k
Transaction Summary
===================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 600 k
Is this ok [y/N]: y
Downloading Packages:
perl-DBI-1.52-2.el5.x86_64.rpm | 600 kB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-DBI 1/1