[root@mha-04 data]# masterha_check_repl --conf=/mha/conf/app1.cnf
Wed Jul 20 15:20:59 2022 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Wed Jul 20 15:20:59 2022 - [info] Reading application default configuration from /mha/conf/app1.cnf..
Wed Jul 20 15:20:59 2022 - [info] Reading server configuration from /mha/conf/app1.cnf..
Wed Jul 20 15:20:59 2022 - [info] MHA::MasterMonitor version 0.56.
Wed Jul 20 15:20:59 2022 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Att empt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 37) line 3.
at /usr/share/perl5/vendor_perl/MHA/DBHelper.pm line 205.
at /usr/share/perl5/vendor_perl/MHA/Server.pm line 166.
Wed Jul 20 15:20:59 2022 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Att empt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 37) line 3.
at /usr/share/perl5/vendor_perl/MHA/DBHelper.pm line 205.
at /usr/share/perl5/vendor_perl/MHA/Server.pm line 166.
Wed Jul 20 15:21:00 2022 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln309] Got fatal error, stopping operati ons
Wed Jul 20 15:21:00 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking config urations. at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 326.
Wed Jul 20 15:21:00 2022 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring serv ers.
Wed Jul 20 15:21:00 2022 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
解决方法:
[root@mha-04 ~]# yum install -y cpan
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* epel: mirror.lzu.edu.cn
* extras: mirrors.cn99.com
* updates: mirrors.cn99.com
Resolving Dependencies
--> Running transaction check
---> Package perl-CPAN.noarch 0:1.9800-299.el7_9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================
Installing:
perl-CPAN noarch 1.9800-299.el7_9 updates 293 k
Transaction Summary
==============================================================================================================================
Install 1 Package
Total download size: 293 k
Installed size: 745 k
Downloading packages:
perl-CPAN-1.9800-299.el7_9.noarch.rpm | 293 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : perl-CPAN-1.9800-299.el7_9.noarch 1/1
Verifying : perl-CPAN-1.9800-299.el7_9.noarch 1/1
Installed:
perl-CPAN.noarch 0:1.9800-299.el7_9
Complete!
[root@mha-04 ~]# cpan -D DBI
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes] yes
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib] sudo
Autoconfigured everything but 'urllist'.
Now you need to choose your CPAN mirror sites. You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] yes
Trying to fetch a mirror list from the Internet
Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/MIRRORED.BY
Looking for CPAN mirrors near you (please be patient)
.. done!
New urllist
http://www.cpan.org/
Autoconfiguration complete.
commit: wrote '/root/.cpan/CPAN/MyConfig.pm'
You can re-run configuration any time with 'o conf init' in the CPAN shell
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Wed, 20 Jul 2022 06:56:09 GMT
HTTP::Date not available
..............
New CPAN.pm version (v2.34) available.
[Currently running version is v1.9800]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
..............................................................DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.cpan/Metadata
DBI
-------------------------------------------------------------------------
(no description)
T/TI/TIMB/DBI-1.643.tar.gz
/usr/lib64/perl5/vendor_perl/DBI.pm
Installed: 1.627
CPAN: 1.643 Not up to date
Tim Bunce (TIMB)
Tim.Bunce@pobox.com
[root@mha-04 ~]# cpan DBD::mysql
Reading '/root/.cpan/Metadata'
Database was generated on Wed, 20 Jul 2022 06:56:09 GMT
Running install for module 'DBD::mysql'
Running make for D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/D/DV/DVEEDEN/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
CPAN.pm: Building D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
Can't locate Devel/CheckLib.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 Makefile.PL line 12.
BEGIN failed--compilation aborted at Makefile.PL line 12.
Warning: No success on command[/usr/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites