MySQL MHA /usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted
在公司随便找3台测试机搭个MHA,下面这个问题折腾了三天,之前没遇到过,查了OS版本发现一致,可能是不同人弄的OS吧,知道是cpan的问题就是搞不定,郁闷。。。
[root@test247 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Wed Dec 4 11:53:59 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Wed Dec 4 11:53:59 2019 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Wed Dec 4 11:53:59 2019 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Wed Dec 4 11:53:59 2019 - [info] MHA::MasterMonitor version 0.56.
Wed Dec 4 11:54:00 2019 - [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 26) 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 Dec 4 11:54:00 2019 - [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 26) 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 Dec 4 11:54:00 2019 - [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 26) 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 Dec 4 11:54:01 2019 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln309] Got fatal error, stopping operations
Wed Dec 4 11:54:01 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 326
Wed Dec 4 11:54:01 2019 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Wed Dec 4 11:54:01 2019 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!
参考下面帖子发现结果还有异常
https://www.cnblogs.com/fangyuan303687320/p/9475279.html
yum install -y cpan
cpan -D DBI
# [yes---sudo]
--上面这不执行了好几分钟,输入了很多次yes
cpan DBD::mysql
还是出现下面的异常
--异常
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .............................. 1/6
# Failed test 'use DBD::mysql;'
# at t/00base.t line 15.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/root/.cpan/build/DBD-mysql-4.050-d0WgOf/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.20: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.
# at t/00base.t line 15
# Compilation failed in require at t/00base.t line 15.
# BEGIN failed--compilation aborted at t/00base.t line 15.
Bailout called. Further testing stopped: Unable to load DBD::mysql
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports DVEEDEN/DBD-mysql-4.050.tar.gz
Running make install
make test had returned bad status, won't install without force
最后发现需要先执行下这个才可以,需要回答几次yes
[root@test247 ~]# cpan
cpan[1]> force install GD
...
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/auto/GD/GD.so
Installing /usr/local/lib64/perl5/auto/GD/GD.bs
Installing /usr/local/lib64/perl5/GD.pm
Installing /usr/local/lib64/perl5/auto/GD/autosplit.ix
Installing /usr/local/lib64/perl5/GD/Polygon.pm
Installing /usr/local/lib64/perl5/GD/Simple.pm
Installing /usr/local/lib64/perl5/GD/Group.pm
Installing /usr/local/lib64/perl5/GD/Image.pm
Installing /usr/local/lib64/perl5/GD/Polyline.pm
Installing /usr/local/share/man/man1/bdf2gdfont.pl.1
Installing /usr/local/share/man/man3/GD.3pm
Installing /usr/local/share/man/man3/GD::Polygon.3pm
Installing /usr/local/share/man/man3/GD::Group.3pm
Installing /usr/local/share/man/man3/GD::Simple.3pm
Installing /usr/local/share/man/man3/GD::Polyline.3pm
Installing /usr/local/share/man/man3/GD::Image.3pm
Installing /usr/local/bin/bdf2gdfont.pl
Appending installation info to /usr/lib64/perl5/perllocal.pod
RURBAN/GD-2.71.tar.gz
/usr/bin/make install -- OK
cpan[2]> exit
[root@test247 ~]# cpan DBD::mysql
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Wed, 04 Dec 2019 02:29:02 GMT
Running install for module 'DBD::mysql'
CPAN: YAML loaded ok (v0.70)
Running make for D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
Checksum for /root/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
...
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
...
Prepending /root/.cpan/build/DBD-mysql-4.050-LtZCXU/blib/arch /root/.cpan/build/DBD-mysql-4.050-LtZCXU/blib/lib to PERL5LIB for 'install'
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so
Installing /usr/local/lib64/perl5/auto/DBD/mysql/mysql.bs
Installing /usr/local/lib64/perl5/Bundle/DBD/mysql.pm
Installing /usr/local/lib64/perl5/DBD/mysql.pm
Installing /usr/local/lib64/perl5/DBD/mysql/GetInfo.pm
Installing /usr/local/lib64/perl5/DBD/mysql/INSTALL.pod
Installing /usr/local/share/man/man3/DBD::mysql.3pm
Installing /usr/local/share/man/man3/Bundle::DBD::mysql.3pm
Installing /usr/local/share/man/man3/DBD::mysql::INSTALL.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/make install -- OK
[root@test247 ~]#
再运行OK了
[root@test247 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Wed Dec 4 12:20:09 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Wed Dec 4 12:20:09 2019 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Wed Dec 4 12:20:09 2019 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Wed Dec 4 12:20:09 2019 - [info] MHA::MasterMonitor version 0.56.
Wed Dec 4 12:20:10 2019 - [info] GTID failover mode = 0
Wed Dec 4 12:20:10 2019 - [info] Dead Servers:
Wed Dec 4 12:20:10 2019 - [info] Alive Servers:
Wed Dec 4 12:20:10 2019 - [info] 192.168.5.247(192.168.5.247:3306)
Wed Dec 4 12:20:10 2019 - [info] 192.168.5.93(192.168.5.93:3306)
Wed Dec 4 12:20:10 2019 - [info] 192.168.5.94(192.168.5.94:3306)
Wed Dec 4 12:20:10 2019 - [info] Alive Slaves:
Wed Dec 4 12:20:10 2019 - [info] 192.168.5.93(192.168.5.93:3306) Version=5.7.21-log (oldest major version between slaves) log-bin:enabled
Wed Dec 4 12:20:10 2019 - [info] Replicating from 192.168.5.247(192.168.5.247:3306)
Wed Dec 4 12:20:10 2019 - [info] Primary candidate for the new Master (candidate_master is set)
Wed Dec 4 12:20:10 2019 - [info] 192.168.5.94(192.168.5.94:3306) Version=5.7.21-log (oldest major version between slaves) log-bin:enabled
Wed Dec 4 12:20:10 2019 - [info] Replicating from 192.168.5.247(192.168.5.247:3306)
Wed Dec 4 12:20:10 2019 - [info] Current Alive Master: 192.168.5.247(192.168.5.247:3306)
Wed Dec 4 12:20:10 2019 - [info] Checking slave configurations..
Wed Dec 4 12:20:10 2019 - [info] Checking replication filtering settings..
Wed Dec 4 12:20:10 2019 - [info] binlog_do_db= , binlog_ignore_db=
Wed Dec 4 12:20:10 2019 - [info] Replication filtering check ok.
Wed Dec 4 12:20:10 2019 - [info] GTID (with auto-pos) is not supported
Wed Dec 4 12:20:10 2019 - [info] Starting SSH connection tests..
Wed Dec 4 12:20:12 2019 - [info] All SSH connection tests passed successfully.
Wed Dec 4 12:20:12 2019 - [info] Checking MHA Node version..
Wed Dec 4 12:20:13 2019 - [info] Version check ok.
Wed Dec 4 12:20:13 2019 - [info] Checking SSH publickey authentication settings on the current master..
Wed Dec 4 12:20:13 2019 - [info] HealthCheck: SSH to 192.168.5.247 is reachable.
Wed Dec 4 12:20:13 2019 - [info] Master MHA Node version is 0.56.
Wed Dec 4 12:20:13 2019 - [info] Checking recovery script configurations on 192.168.5.247(192.168.5.247:3306)..
Wed Dec 4 12:20:13 2019 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/data/mysql/logs/bin-log --output_file=/tmp/save_binary_logs_test --manager_version=0.56 --start_file=mysql-bin.000008
Wed Dec 4 12:20:13 2019 - [info] Connecting to root@192.168.5.247(192.168.5.247:22)..
Creating /tmp if not exists.. ok.
Checking output directory is accessible or not..
ok.
Binlog found at /data/mysql/logs/bin-log, up to mysql-bin.000008
Wed Dec 4 12:20:13 2019 - [info] Binlog setting check done.
Wed Dec 4 12:20:13 2019 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Wed Dec 4 12:20:13 2019 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='monitor' --slave_host=192.168.5.93 --slave_ip=192.168.5.93 --slave_port=3306 --workdir=/tmp --target_version=5.7.21-log --manager_version=0.56 --relay_log_info=/data/mysql/relay-log.info --relay_dir=/data/mysql/data/ --slave_pass=xxx
Wed Dec 4 12:20:13 2019 - [info] Connecting to root@192.168.5.93(192.168.5.93:22)..
Checking slave recovery environment settings..
Opening /data/mysql/relay-log.info ... ok.
Relay log found at /data/mysql/logs/relay-log, up to relay-bin.000015
Temporary relay log file is /data/mysql/logs/relay-log/relay-bin.000015
Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Wed Dec 4 12:20:13 2019 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='monitor' --slave_host=192.168.5.94 --slave_ip=192.168.5.94 --slave_port=3306 --workdir=/tmp --target_version=5.7.21-log --manager_version=0.56 --relay_log_info=/data/mysql/relay-log.info --relay_dir=/data/mysql/data/ --slave_pass=xxx
Wed Dec 4 12:20:13 2019 - [info] Connecting to root@192.168.5.94(192.168.5.94:22)..
Checking slave recovery environment settings..
Opening /data/mysql/relay-log.info ... ok.
Relay log found at /data/mysql/logs/relay-log, up to relay-bin.000015
Temporary relay log file is /data/mysql/logs/relay-log/relay-bin.000015
Testing mysql connection and privileges..mysql: [Warning] Using a password on the command line interface can be insecure.
done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Wed Dec 4 12:20:14 2019 - [info] Slaves settings check done.
Wed Dec 4 12:20:14 2019 - [info]
192.168.5.247(192.168.5.247:3306) (current master)
+--192.168.5.93(192.168.5.93:3306)
+--192.168.5.94(192.168.5.94:3306)
Wed Dec 4 12:20:14 2019 - [info] Checking replication health on 192.168.5.93..
Wed Dec 4 12:20:14 2019 - [info] ok.
Wed Dec 4 12:20:14 2019 - [info] Checking replication health on 192.168.5.94..
Wed Dec 4 12:20:14 2019 - [info] ok.
Wed Dec 4 12:20:14 2019 - [info] Checking master_ip_failover_script status:
Wed Dec 4 12:20:14 2019 - [info] /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.5.247 --orig_master_ip=192.168.5.247 --orig_master_port=3306
Wed Dec 4 12:20:14 2019 - [info] OK.
Wed Dec 4 12:20:14 2019 - [warning] shutdown_script is not defined.
Wed Dec 4 12:20:14 2019 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.
[root@test247 ~]#
MySQL MHA /usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted的更多相关文章
- mha安装报错 [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln361] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf
查找资料 参考 http://blog.51cto.com/16769017/1878451 解决方法: 在两个从库上开启二进制日志即可(花了 一天时间,找不到解决方法,最后还是靠自己的理解及测试解决 ...
- sendEmail报错:at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm
sendEmail发送邮件是出现以下报错: ******************************************************************* Using the ...
- CentOS 7 下sendEmail发邮件失败,提示invalid SSL_version specified at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 415.
系统环境CentOS Linux release 7.2.1511 (Core) sendEmail发送邮件是出现以下报错:************************************** ...
- mysql高可用研究(一) 主从+MHA架构 (转)
最近在研究mysql的高可用架构,自己想总结下常用的高可用方案都有哪些.有哪些优缺点以及应用的场景?搞得是头昏脑涨,天昏地暗,看了诸多资料,每次都觉得公说公有理婆说婆有理.其实嘛,大家说的都有一定的道 ...
- mysql高可用研究(一) 主从+MHA架构
最近在研究mysql的高可用架构,自己想总结下常用的高可用方案都有哪些.有哪些优缺点以及应用的场景?搞得是头昏脑涨,天昏地暗,看了诸多资料,每次都觉得公说公有理婆说婆有理.其实嘛,大家说的都有一定的道 ...
- Mysql 5.7 CentOS 7 安装MHA
Table of Contents 1. MHA简介 1.1. 功能 1.2. MHA切换逻辑 1.3. 工具 2. 环境 2.1. 软件 2.2. 环境 3. Mysql 主从复制 3.1. Mys ...
- 执行scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysqldb命令时一直报错:
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /u ...
- mysql MHA报错 Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 99.
如果发现如下错误: Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MH ...
- MySQL高可用架构之基于MHA的搭建
一.MySQL MHA架构介绍: MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Fa ...
随机推荐
- Linux的curl和wget
wget wget命令用来从指定的URL下载文件.wget非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性,如果是由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕.如果是服 ...
- 【IntelliJ IDEA】IDEA自动生成serialVersionUID的办法
digest:实体对象实现了java.io.Serializable接口后,一般都会提供一个serialVersionUID一做版本区分.在IDEA里,可以通过一些设置,帮助我们快速生成serialV ...
- 原生线程池这么强大,Tomcat 为何还需扩展线程池?
前言 Tomcat/Jetty 是目前比较流行的 Web 容器,两者接受请求之后都会转交给线程池处理,这样可以有效提高处理的能力与并发度.JDK 提高完整线程池实现,但是 Tomcat/Jetty 都 ...
- Flask入门学习——自定义一个url转换器
我们知道,flask的url规则是可以添加变量部分的,这个参数变量是写在尖括号里的,比如:/item/<id>/,如果需要指出参数的类型要符合<converter:vai ...
- 04-kubernetes 资源清单定义入门
目录 资源对象 创建资源的方法 清单帮助命令 创建测试清单 资源的三种创建方式 资源对象 workload:Pod, ReplicaSet, Deployment, StatefulSet, Daem ...
- xmake从入门到精通8:切换编译模式
xmake是一个基于Lua的轻量级现代化c/c++的项目构建工具,主要特点是:语法简单易上手,提供更加可读的项目维护,实现跨平台行为一致的构建体验. 本文我们会详细介绍下如何在项目构建过程中切换deb ...
- MySql简单的增删改查语句 js
最近在项目中需要连接数据库,做增删改查的功能,sql语句整理做了以下记录(基于NodeJs,注:data为你的真实数据): (一)新增插入表中数据: sql: 'insert into work(表名 ...
- MySQL-简介-安装(5.5版和5.7版)
1.什么是MySQL (1)MySQL是一种关联数据库管理系统. (2)关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库中,可以增加速度,提高灵活性. (3)MySQL使用的是数据库常 ...
- 深入浅出-iOS程序性能优化
iOS应用是非常注重用户体验的,不光是要求界面设计合理美观,也要求各种UI的反应灵敏,我相信大家对那种一拖就卡卡卡的 TableView 应用没什么好印象.还记得12306么,那个速度,相信大家都受不 ...
- RocketMq在SparkStreaming中的总结
其实Rocketmq的给第三方的插件已经全了,如果大家有兴趣的话请移步https://github.com/apache/rocketmq-externals.本文主要是结合笔者已有的rmq在spar ...