mysql MHA安装搭建问题实验总结


问题一:
[root@mvxl0784 apps]# perl -MCPAN -e "install Config::Tiny"
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
CPAN: Compress::Zlib loaded ok (v2.02)
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
CPAN: Time::HiRes loaded ok (v1.9721)
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
DONE
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 27) line 1.
 at /usr/share/perl5/CPAN/Index.pm line 518
        CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl5/CPAN/Index.pm line 85
        CPAN::Index::reload('CPAN::Index') called at /usr/share/perl5/CPAN.pm line 955
        CPAN::exists('CPAN=HASH(0x22f6490)', 'CPAN::Module', 'Config::Tiny') called at /usr/share/perl5/CPAN/Shell.pm line 1243
        CPAN::Shell::expandany('CPAN::Shell', 'Config::Tiny') called at /usr/share/perl5/CPAN/Shell.pm line 1639
        CPAN::Shell::rematein('CPAN::Shell', 'install', 'Config::Tiny') called at /usr/share/perl5/CPAN/Shell.pm line 1935
        CPAN::Shell::__ANON__('CPAN::Shell', 'Config::Tiny') called at /usr/share/perl5/CPAN.pm line 198
        CPAN::AUTOLOAD('Config::Tiny') called at -e line 1

解决方法:
[root@mvxl0784 ~]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan> o conf urllist unshift http://www.perl.com/CPAN/
cpan> o conf commit

cpan>reload index

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> reload index
CPAN: Storable loaded ok (v2.20)
CPAN: LWP::UserAgent loaded ok (v5.833)
CPAN: Time::HiRes loaded ok (v1.9721)
Fetching with LWP:
  http://www.perl.com/CPAN/authors/01mailrc.txt.gz
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
  http://www.perl.com/CPAN/modules/02packages.details.txt.gz
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 24 May 2016 07:53:55 GMT
.............
  New CPAN.pm version (v2.10) available.
  [Currently running version is v1.9402]
  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 LWP:
  http://www.perl.com/CPAN/modules/03modlist.data.gz
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Going to write /root/.cpan/Metadata

设置完后,再查看/usr/share/perl5/CPAN/Config.pm文件中的url是否正确。

问题二:
[apps@mvxl0784 script]$ /apps/sh/mha/mha_manager/bin/masterha_check_ssh --global_conf=/apps/conf/mha/masterha_base.cnf --conf=/apps/conf/mha/app1.cnf
Can't locate MHA/NodeConst.pm in @INC (@INC contains: /apps/sh/mha/mha_node/share/perl5 /apps/lib/mha/mha_manager /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 /apps/lib/mha/mha_manager/MHA/ManagerConst.pm line 25.
BEGIN failed--compilation aborted at /apps/lib/mha/mha_manager/MHA/ManagerConst.pm line 25.
Compilation failed in require at /apps/lib/mha/mha_manager/MHA/Server.pm line 27.
BEGIN failed--compilation aborted at /apps/lib/mha/mha_manager/MHA/Server.pm line 27.
Compilation failed in require at /apps/lib/mha/mha_manager/MHA/Config.pm line 29.
BEGIN failed--compilation aborted at /apps/lib/mha/mha_manager/MHA/Config.pm line 29.
Compilation failed in require at /apps/lib/mha/mha_manager/MHA/SSHCheck.pm line 32.
BEGIN failed--compilation aborted at /apps/lib/mha/mha_manager/MHA/SSHCheck.pm line 32.
Compilation failed in require at /apps/sh/mha/mha_manager/bin/masterha_check_ssh line 25.
BEGIN failed--compilation aborted at /apps/sh/mha/mha_manager/bin/masterha_check_ssh line 25.

解决方法:
将以下加入/etc/profile
export PERL5LIB=/apps/lib/mha/mha_node
执行source /etc/profilemanager
重新再安装manager。


问题三:
[apps@mvxl0784 ~]$ /apps/sh/mha/mha_manager/bin/masterha_check_ssh \
> --global_conf=/apps/conf/mha/masterha_base.cnf --conf=/apps/conf/mha/app1.cnf
Can't locate MHA/SSHCheck.pm in @INC (@INC contains: /apps/lib/mha/mha_node/x86_64-linux-thread-multi /apps/lib/mha/mha_node /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 /apps/sh/mha/mha_manager/bin/masterha_check_ssh line 25.
BEGIN failed--compilation aborted at /apps/sh/mha/mha_manager/bin/masterha_check_ssh line 25.

解决方法:
$HOME/.bashrc加入:
export PERL5LIB=/apps/lib/mha/mha_node:/apps/lib/mha/mha_manager

问题四:
[apps@mvxl0784 mha]$ /apps/sh/mha/mha_manager/bin/masterha_check_repl --global_conf=/apps/conf/mha/masterha_base.cnf --conf=/apps/conf/mha/app1.cnf
Wed May 25 17:40:03 2016 - [info] Reading default configuration from /apps/conf/mha/masterha_base.cnf..
Wed May 25 17:40:03 2016 - [info] Reading application default configuration from /apps/conf/mha/app1.cnf..
Wed May 25 17:40:03 2016 - [info] Reading server configuration from /apps/conf/mha/app1.cnf..
Wed May 25 17:40:03 2016 - [info] MHA::MasterMonitor version 0.56.
Wed May 25 17:40:04 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/ServerManager.pm, ln188] There is no alive server. We can't do failover
Wed May 25 17:40:04 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm line 326.
Wed May 25 17:40:04 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Wed May 25 17:40:04 2016 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK

解决方法:
在配置文件上加入port=3307:
[server1]
hostname=10.16.24.107
port=3307
master_binlog_dir=/apps/dbdat/mariadb101_data3307/log
candidate_master=1

问题五:
Thu May 26 13:54:18 2016 - [error][/apps/lib/mha/mha_manager/MHA/ManagerUtil.pm, ln122] Got error when getting node version. Error:
Thu May 26 13:54:18 2016 - [error][/apps/lib/mha/mha_manager/MHA/ManagerUtil.pm, ln123]
bash: apply_diff_relay_logs: command not found
Thu May 26 13:54:18 2016 - [error][/apps/lib/mha/mha_manager/MHA/ManagerUtil.pm, ln150] node version on 10.16.24.108 not found! Is MHA Node package installed ?
 at /apps/lib/mha/mha_manager/MHA/MasterMonitor.pm line 374.
Thu May 26 13:54:18 2016 - [error][/apps/lib/mha/mha_manager/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations. node version on 10.16.24.108 not found! Is MHA Node package installed ?
 at /apps/lib/mha/mha_manager/MHA/MasterMonitor.pm line 374.
        ...propagated at /apps/lib/mha/mha_manager/MHA/ManagerUtil.pm line 151.
Thu May 26 13:54:18 2016 - [error][/apps/lib/mha/mha_manager/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Thu May 26 13:54:18 2016 - [info] Got exit code 1 (Not master dead).

解决方法:
$HOME/.bashrc加入:
export PERLLIB=/apps/sh/mha/mha_node/share/perl5:/apps/lib/mha/mha_manager:/apps/lib/mha/mha_manager/MHA:/apps/lib/mha/mha_node/MHA


问题六:
Thu May 26 12:47:51 2016 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=10.16.24.109 --slave_ip=10.16.24.109 --slave_port=3307 --workdir=/apps/logs/mha/app1 --target_version=10.1.12-MariaDB --manager_version=0.56 --relay_log_info=/apps/dbdat/mariadb101_data3307/relay-log.info  --relay_dir=/apps/dbdat/mariadb101_data3307/  --slave_pass=xxx
Thu May 26 12:47:51 2016 - [info]   Connecting to [email protected](10.16.24.109:22)..
Can't exec "mysqlbinlog": No such file or directory at /apps/lib/mha/mha_node/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc 1:0, please verify PATH, LD_LIBRARY_PATH, and client options
 at /apps/sh/mha/mha_node/bin/apply_diff_relay_logs line 493.
Thu May 26 12:47:51 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!
Thu May 26 12:47:51 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln413] Slave configuration failed.
Thu May 26 12:47:51 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /apps/sh/mha/mha_manager/bin/masterha_check_repl line 48.
Thu May 26 12:47:51 2016 - [error][/usr/lib64/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Thu May 26 12:47:51 2016 - [info] Got exit code 1 (Not master dead).

解决方法:
在/usr/local中建立一个link:
ln -s /apps/svr/mariadb101 mysql
再将/usr/local/mysql/bin增加到$HOME/.bashrc的$PATH中

 

你可能感兴趣的:(mysql高可用)