MySQL MHA /usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted

来源:https://www.cnblogs.com/ritchy/archive/2019/12/04/11983141.html
-Advertisement-
Play Games

在公司隨便找3台測試機搭個MHA,下麵這個問題折騰了三天,之前沒遇到過,查了OS版本發現一致,可能是不同人弄的OS吧,知道是cpan的問題就是搞不定,鬱悶。。。[root@test247 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnfWed ...


在公司隨便找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 [email protected](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 [email protected](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 [email protected](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 ~]#


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 表: 學生(*學號,姓名,性別,年齡,專業) create table student( sno char(13) primary key, sname varchar(20) not null, ssex char(2), sage smallint, sdept varchar(30) ); 課 ...
  • 很多用於當SQL Server2017 安裝完成後開始菜單找不到啟動項無法啟動SQL Server2017 其實你只需要安裝一下SSMS-Setup-CHS就可以了 安裝完成之後就有了 SSMS-Setup-CHS 下載鏈接: 鏈接:https://pan.baidu.com/s/18EcH16Ok ...
  • 函數式編程(Functional Programming)是一種編程風格,它是相對於指令式編程風格而言的,常見的面向對象編程就是指令式編程風格。 指令式編程是面向電腦硬體的抽象,有變數(對應著存儲單元),賦值語句(獲取、存儲指令),表達式(記憶體引用和算術運算)和控制語句(跳轉語句)。 而函數式編程 ...
  • 1、到Navicat官網下載使用版本進行安裝,具體操作不再詳述。Navcat官網下載鏈接:http://www.navicat.com.cn/download/navicat-premium ; 2、到GitHub下載DoubleLabyrinth大神發佈的Navicat Keygen,具體操作不再 ...
  • 一 資料庫初識 1.1 什麼是資料庫 資料庫(DataBase,簡稱DB),簡而言之可視為電子化的文件櫃 存儲電子文件的處所,用戶可以對文件中的數據運行新增,截取,更新,刪除等操作. 所謂資料庫是以一定方式儲存在一起,能予多個用戶 共用,具有儘可能小的冗餘度,與應用程式彼此獨立的數據集合. 資料庫的 ...
  • 最近項目遇到根據關鍵字匹配度排序,要求關鍵字匹配相等排在第一,關鍵字匹配最左邊排第二,關鍵字匹配最右邊排第三,關鍵字匹配中間排最後;遇到這樣查詢排序場景,用MySQL如何實現?用搜索引擎Elasticsearch如何實現? 方法一:按照上面需求用聯合查詢,可以實現方案,但是當數據量很大時,聯合查詢效 ...
  • 本文探討如何使用 RocketMQ Binder 完成 Spring Cloud 應用消息的訂閱和發佈。 介紹 "RocketMQ" 是一款開源的分散式消息系統,基於高可用分散式集群技術,提供低延時的、高可靠的消息發佈與訂閱服務,廣泛應用於多個領域,包括非同步通信解耦、企業解決方案、金融支付、電信、電 ...
  • 由於程式bug,導致之前很多數據入庫後信息不全,好在有基礎信息表,可以通過基礎信息表更新缺失欄位信息 1、通過 inner join語法實現多關聯更新 update a set a.name = b.name from product_detail a inner join product_base ...
一周排行
    -Advertisement-
    Play Games
  • Timer是什麼 Timer 是一種用於創建定期粒度行為的機制。 與標準的 .NET System.Threading.Timer 類相似,Orleans 的 Timer 允許在一段時間後執行特定的操作,或者在特定的時間間隔內重覆執行操作。 它在分散式系統中具有重要作用,特別是在處理需要周期性執行的 ...
  • 前言 相信很多做WPF開發的小伙伴都遇到過表格類的需求,雖然現有的Grid控制項也能實現,但是使用起來的體驗感並不好,比如要實現一個Excel中的表格效果,估計你能想到的第一個方法就是套Border控制項,用這種方法你需要控制每個Border的邊框,並且在一堆Bordr中找到Grid.Row,Grid. ...
  • .NET C#程式啟動閃退,目錄導致的問題 這是第2次踩這個坑了,很小的編程細節,容易忽略,所以寫個博客,分享給大家。 1.第一次坑:是windows 系統把程式運行成服務,找不到配置文件,原因是以服務運行它的工作目錄是在C:\Windows\System32 2.本次坑:WPF桌面程式通過註冊表設 ...
  • 在分散式系統中,數據的持久化是至關重要的一環。 Orleans 7 引入了強大的持久化功能,使得在分散式環境下管理數據變得更加輕鬆和可靠。 本文將介紹什麼是 Orleans 7 的持久化,如何設置它以及相應的代碼示例。 什麼是 Orleans 7 的持久化? Orleans 7 的持久化是指將 Or ...
  • 前言 .NET Feature Management 是一個用於管理應用程式功能的庫,它可以幫助開發人員在應用程式中輕鬆地添加、移除和管理功能。使用 Feature Management,開發人員可以根據不同用戶、環境或其他條件來動態地控制應用程式中的功能。這使得開發人員可以更靈活地管理應用程式的功 ...
  • 在 WPF 應用程式中,拖放操作是實現用戶交互的重要組成部分。通過拖放操作,用戶可以輕鬆地將數據從一個位置移動到另一個位置,或者將控制項從一個容器移動到另一個容器。然而,WPF 中預設的拖放操作可能並不是那麼好用。為瞭解決這個問題,我們可以自定義一個 Panel 來實現更簡單的拖拽操作。 自定義 Pa ...
  • 在實際使用中,由於涉及到不同編程語言之間互相調用,導致C++ 中的OpenCV與C#中的OpenCvSharp 圖像數據在不同編程語言之間難以有效傳遞。在本文中我們將結合OpenCvSharp源碼實現原理,探究兩種數據之間的通信方式。 ...
  • 一、前言 這是一篇搭建許可權管理系統的系列文章。 隨著網路的發展,信息安全對應任何企業來說都越發的重要,而本系列文章將和大家一起一步一步搭建一個全新的許可權管理系統。 說明:由於搭建一個全新的項目過於繁瑣,所有作者將挑選核心代碼和核心思路進行分享。 二、技術選擇 三、開始設計 1、自主搭建vue前端和. ...
  • Csharper中的表達式樹 這節課來瞭解一下表示式樹是什麼? 在C#中,表達式樹是一種數據結構,它可以表示一些代碼塊,如Lambda表達式或查詢表達式。表達式樹使你能夠查看和操作數據,就像你可以查看和操作代碼一樣。它們通常用於創建動態查詢和解析表達式。 一、認識表達式樹 為什麼要這樣說?它和委托有 ...
  • 在使用Django等框架來操作MySQL時,實際上底層還是通過Python來操作的,首先需要安裝一個驅動程式,在Python3中,驅動程式有多種選擇,比如有pymysql以及mysqlclient等。使用pip命令安裝mysqlclient失敗應如何解決? 安裝的python版本說明 機器同時安裝了 ...