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/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义