mha 安装部署报错 failed: Attempt to reload DBD/mysql.pm aborted

 
[root@hz-op-mysql03.test /root]# masterha_check_repl --conf=/home/mha/conf/app1.conf
Tue Sep 29 14:16:25 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Sep 29 14:16:25 2020 - [info] Reading application default configuration from /home/mha/conf/app1.conf..
Tue Sep 29 14:16:25 2020 - [info] Reading server configuration from /home/mha/conf/app1.conf..
Tue Sep 29 14:16:25 2020 - [info] MHA::MasterMonitor version 0.58.
Tue Sep 29 14:16:25 2020 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt 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 208.
at /usr/share/perl5/vendor_perl/MHA/Server.pm line 166.
Tue Sep 29 14:16:25 2020 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt 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 208.
at /usr/share/perl5/vendor_perl/MHA/Server.pm line 166.
Tue Sep 29 14:16:25 2020 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt 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 208.
at /usr/share/perl5/vendor_perl/MHA/Server.pm line 166.
Tue Sep 29 14:16:26 2020 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln309] Got fatal error, stopping operations
Tue Sep 29 14:16:26 2020 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations.  at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 329.
Tue Sep 29 14:16:26 2020 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Tue Sep 29 14:16:26 2020 - [info] Got exit code 1 (Not master dead).
 
MySQL Replication Health is NOT OK!
 
参考网上文档并没有解决问题,因为处理过程中报错
 
yum install -y cpan
cpan -D DBI     
cpan DBD::mysql
 
cpan DBD::mysql
 
[root@hz-op-mysql03.test /root]# cpan DBD::mysql
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 28 Sep 2020 02:17:03 GMT
Running install for module 'DBD::mysql'
Running make for D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
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 exec "mysql_config": No such file or directory at Makefile.PL line 89.
 
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
 
 
PLEASE NOTE:
 
For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
 
mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';
 
You can also optionally set the user to run 'make test' with:
 
perl Makefile.PL --testuser=username
 
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Failed to determine directory of mysql.h. Use
 
  perl Makefile.PL --cflags=-I<dir>
 
to set this directory. For details see DBD::mysql::INSTALL,
section "C Compiler flags" or type
 
  perl Makefile.PL --help
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
 
 
 
解决这个问题 Can't exec "mysql_config": No such file or directory at Makefile.PL line 89. 库文件缺失
 
cp -r /root/5.7.30/include/* /usr/include/
cp -r /root/5.7.30/lib/* /usr/lib/
 
 
posted @ 2020-09-29 16:38  mhabbyo  阅读(751)  评论(0编辑  收藏  举报