masterha_check_repl报错汇总

[[email protected] ~]#masterha_check_repl --conf=/etc/masterha/app1.cnf

导致如下报错的原因主要有两类

1.mysql的安装时用源码安装,导致mysql的目录与MHA默认的目录不一致。解决办法用ln -s做相关软连接。注:我的mysql数据库是用mysql用户安装的,MHA是用root用户安装的,如果在同一个用户下安装不知是否可以避免此类问题

2.candidate_master对应的用户权限不足导致。

以下内容摘自网络

报错记录1:

[[email protected] ~]# masterha_check_repl--conf=/etc/masterha/app1.cnf
Tue Apr 7 22:31:06 2015 - [warning] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Tue Apr 7 22:31:07 2015 - [info] Reading application default configuration from/etc/masterha/app1.cnf..
Tue Apr 7 22:31:07 2015 - [info] Reading server configuration from/etc/masterha/app1.cnf..
Tue Apr 7 22:31:07 2015 - [info] MHA::MasterMonitor version 0.56.
Tue Apr 7 22:31:07 2015 - [error][/usr/local/share/perl5/MHA/Server.pm,ln303] Getting relay log directory orcurrent relay logfile from replication table failed on192.168.52.130(192.168.52.130:3306)!
Tue Apr 7 22:31:07 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln424] Error happened on checking configurations. at /usr/local/share/perl5/MHA/ServerManager.pmline 315
Tue Apr 7 22:31:07 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln523] Error happened on monitoring servers.
Tue Apr 7 22:31:07 2015 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

[[email protected] ~]#

解决办法:在192.168.52.130上面,vim /etc/my.cnf,在里面添加

relay-log=/home/data/mysql/binlog/mysql-relay-bin
然后重启mysql,再去重新设置slave连接。
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TOMASTER_HOST=‘192.168.52.129‘,MASTER_USER=‘repl‘,MASTER_PASSWORD=‘repl_1234‘,MASTER_LOG_FILE=‘mysql-bin.000178‘,MASTER_LOG_POS=459;
START SLAVE;
Ok,搞定了。

报错记录2
[[email protected] perl]# masterha_check_repl--conf=/etc/masterha/app1.cnf
Thu Apr 9 00:54:32 2015 - [warning] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Thu Apr 9 00:54:32 2015 - [info] Reading application default configuration from/etc/masterha/app1.cnf..
Thu Apr 9 00:54:32 2015 - [info] Reading server configuration from/etc/masterha/app1.cnf..
Thu Apr 9 00:54:32 2015 - [info] MHA::MasterMonitor version 0.56.
Thu Apr 9 00:54:32 2015 - [error][/usr/local/share/perl5/MHA/Server.pm,ln306] Getting relay log directory orcurrent relay logfile from replication table failed on 192.168.52.130(192.168.52.130:3306)!
Thu Apr 9 00:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln424] Error happened on checking configurations. at/usr/local/share/perl5/MHA/ServerManager.pm line 315
Thu Apr 9 00:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln523] Error happened on monitoring servers.
Thu Apr 9 00:54:32 2015 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

[[email protected] perl]#

解决方法:

/etc/masterha/app1.cnf文件里面的参数配置,user和repl_user都是mysql账号,需要创建好,这里是只创建了repl_user而没有创建好user账号:
user=manager
password=manager_1234
repl_user=repl
repl_password=repl_1234

在mysql节点上,建立允许manager 访问数据库的“ manager manager ”账户,主要用于SHOW SLAVESTATUS,RESET SLAVE; 所以需要执行如下命令:
GRANT SUPER,RELOAD,REPLICATIONCLIENT,SELECT ON *.* TO [email protected]‘192.168.52.%‘ IDENTIFIED BY ‘manager_1234‘;

错误记录3
[[email protected] ~]# masterha_check_repl--conf=/etc/masterha/app1.cnf
Thu Apr 9 23:09:05 2015 - [warning] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Thu Apr 9 23:09:05 2015 - [info] Reading application default configuration from/etc/masterha/app1.cnf..
Thu Apr 9 23:09:05 2015 - [info] Reading server configuration from/etc/masterha/app1.cnf..
Thu Apr 9 23:09:05 2015 - [info] MHA::MasterMonitor version 0.56.
Thu Apr 9 23:09:05 2015 - [error][/usr/local/share/perl5/MHA/ServerManager.pm,ln781] Multi-master configuration is detected, but two or more masters areeither writable (read-only is not set) or dead! Check configurations fordetails. Master configurations are as below:
Master 192.168.52.130(192.168.52.130:3306),replicating from 192.168.52.129(192.168.52.129:3306)
Master 192.168.52.129(192.168.52.129:3306),replicating from 192.168.52.130(192.168.52.130:3306)
Thu Apr 9 23:09:05 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln424] Error happened on checking configurations. at/usr/local/share/perl5/MHA/MasterMonitor.pm line 326
Thu Apr 9 23:09:05 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln523] Error happened on monitoring servers.
Thu Apr 9 23:09:05 2015 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

[[email protected] ~]#

解决办法:

mysql> set global read_only=1;
Query OK, 0 rows affected (0.00 sec)
mysql>

报错记录4
Thu Apr 9 23:54:32 2015 - [info] Checking SSH publickey authentication andchecking recovery script configurations on all alive slave servers..
Thu Apr 9 23:54:32 2015 - [info] Executing command : apply_diff_relay_logs --command=test--slave_user=‘manager‘ --slave_host=192.168.52.130 --slave_ip=192.168.52.130--slave_port=3306 --workdir=/var/tmp --target_version=5.6.12-log--manager_version=0.56 --relay_dir=/home/data/mysql/data--current_relay_log=mysqld-relay-bin.000011 --slave_pass=xxx
Thu Apr 9 23:54:32 2015 - [info] Connecting to [email protected](192.168.52.130:22)..
Can‘t exec "mysqlbinlog": No suchfile or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 106.
mysqlbinlog version command failed with rc1:0, please verify PATH, LD_LIBRARY_PATH, and client options
at/usr/local/bin/apply_diff_relay_logs line 493
Thu Apr 9 23:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln205] Slaves settings check failed!
Thu Apr 9 23:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln413] Slave configuration failed.
Thu Apr 9 23:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln424] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48
Thu Apr 9 23:54:32 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln523] Error happened on monitoring servers.
Thu Apr 9 23:54:32 2015 - [info] Got exit code 1 (Not master dead).
MySQL Replication Health is NOT OK!

[[email protected] ~]#

解决办法(所有节点都执行一遍):
[[email protected] ~]# type mysqlbinlog
mysqlbinlog is/usr/local/mysql/bin/mysqlbinlog
[[email protected] ~]#

[[email protected] ~]# ln -s/usr/local/mysql/bin/mysqlbinlog /usr/bin/mysqlbinlog

报错记录5
Thu Apr 9 23:57:24 2015 - [info] Connecting to [email protected](192.168.52.130:22)..
Checking slave recovery environment settings..
Relay log found at /home/data/mysql/data, up to mysqld-relay-bin.000013
Temporary relay log file is /home/data/mysql/data/mysqld-relay-bin.000013
Testing mysql connection and privileges..sh: mysql: command not found
mysql command failed with rc 127:0!
at/usr/local/bin/apply_diff_relay_logs line 375
main::check()called at /usr/local/bin/apply_diff_relay_logs line 497
eval{...} called at /usr/local/bin/apply_diff_relay_logs line 475
main::main()called at /usr/local/bin/apply_diff_relay_logs line 120
Thu Apr 9 23:57:24 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln205] Slaves settings check failed!
Thu Apr 9 23:57:24 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln413] Slave configuration failed.
Thu Apr 9 23:57:24 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln424] Error happened on checking configurations. at /usr/local/bin/masterha_check_repl line 48
Thu Apr 9 23:57:24 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm,ln523] Error happened on monitoring servers.
Thu Apr 9 23:57:24 2015 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

解决办法(所有节点都执行一遍):
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

报错记录6(所切换机器用户权限不匹配):
Fri Apr 10 00:58:36 2015 - [info] Executing command : apply_diff_relay_logs--command=test --slave_user=‘manager‘ --slave_host=192.168.52.130--slave_ip=192.168.52.130 --slave_port=3306 --workdir=/var/tmp--target_version=5.6.12-log --manager_version=0.56--relay_dir=/home/data/mysql/data--current_relay_log=mysqld-relay-bin.000011 --slave_pass=xxx
Fri Apr 10 00:58:36 2015 - [info] Connecting to [email protected](192.168.52.130:22)..
Checking slave recovery environment settings..
Relay log found at /home/data/mysql/data, up to mysqld-relay-bin.000013
Temporary relay log file is/home/data/mysql/data/mysqld-relay-bin.000013
Testing mysql connection and privileges..Warning: Using a password onthe command line interface can be insecure.
ERROR 1142 (42000) at line 1: CREATEcommand denied to user ‘manager‘@‘192.168.52.130‘ for table‘apply_diff_relay_logs_test‘
mysql command failed with rc 1:0!
at/usr/local/bin/apply_diff_relay_logs line 375
main::check()called at /usr/local/bin/apply_diff_relay_logs line 497
eval{...} called at /usr/local/bin/apply_diff_relay_logs line 475
main::main()called at /usr/local/bin/apply_diff_relay_logs line 120
Fri Apr 10 00:58:37 2015 -[error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln205] Slaves settingscheck failed!
Fri Apr 10 00:58:37 2015 -[error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln413] Slave configurationfailed.
Fri Apr 10 00:58:37 2015 -[error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln424] Error happened onchecking configurations. at/usr/local/bin/masterha_check_repl line 48
Fri Apr 10 00:58:37 2015 -[error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln523] Error happened onmonitoring servers.
Fri Apr 10 00:58:37 2015 - [info] Got exitcode 1 (Not master dead).

MySQL Replication Health is NOT OK!

解决办法:

执行如下授权语句sql:
GRANT CREATE,INSERT,UPDATE,DELETE,DROP ON*.* TO [email protected]‘192.168.52.%‘;

时间: 2024-11-08 17:07:47

masterha_check_repl报错汇总的相关文章

eclipse 报错汇总

1.Eclipse 启动时,报错: Fail to create the java virtual machine 已解决.方法:eclipse.ini 中-vmargs-Dosgi.requiredJavaVersion=1.6-Xms40m修改-Xmx768m → -Xmx512meclipse 报错汇总,布布扣,bubuko.com

selenium报错汇总

报错:[error] Could not connect to Selenium Server. Have you started the Selenium Server yet? 解决:selenium两种驱动方式,一是use selenium IDE,一种是use selenium webdriver.在options里去掉勾选enable webdriver playback即可. Google答案地址. http://sqa.stackexchange.com/questions/100

CentOS 6.5 安装YouCompleteMe 报错汇总

支持折腾!!! 编译安装clang 3.6.0   编译器版本低 ====-----编译安装clang 3.6.0   编译器版本低---------------============== [[email protected] llvm-3.6.0]$ tar xf cfe-3.6.0.src.tar.xz  [[email protected] llvm-3.6.0]$ tar xf clang-tools-extra-3.6.0.src.tar.xz  [[email protected]

使用apache benchmark(ab) 测试报错汇总

1.socket: Too many open files (24) 解决方法: [[email protected] ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 14802 max locked memory (kby

SQL Server报错汇总

1)SQL Server服务突然无法启动 问题描述:之前一直没有问题,突然某天无法启动了 解决办法:查看控制面板->管理工具->事件查看器,发现是因为登录失败而无法启动. 找到原因,就简单了,从服务中找到SQL Server的服务,右键属性,然后打开"登录"tab页,选上本地系统,就OK了. 该问题多半是因为更改了操作系统的登录密码造成了.所以要更新sqlserver的账户登录密码.当然,最好的方式就是就是上面的觪决办法了. 这样以后就会自动更新. 2)17051错误 代码

P2V 报错汇总

本文所记录的报错,是笔者操作中遇到的,如果没有在本文中没有你操作中的错误,还是查看日志/var/log/    会有virt-p2v8897877989.log  等这样的日志. P2v 报错 virsh pool-define-as kvm_final --type dir --target /kvm/ pool kvm_final defined error: Failed to reconnect to the hypervisor error: no valid connection e

编译器报错汇总

1.arm7 arm7s 真机32位处理器 arm64  真机64位处理器 2.i386 模拟器32位处理器   x86_64模拟器64位处理器 3.linker .o  可能有依赖库未导入 , 库重复导入: 4.libsqlite3 数据库 今天试了一下iPhone Sqlite3数据库实例操作,发现一个有意思的问题,就是在加Framework时,有些教程说加libsqlite3.dylib有些说加libsqlite3.0.dylib,那到底加哪个呢?经过百度和谷歌得答案如下: 实际上libs

Puppet报错汇总

报错1: 解决:该报错是由于Puppet agent 的时间和Puppet master的时间不一致导致,可以使用ntp同步一下时间即可解决 报错2: 启动mcollective的时候报错 解决:gem install stomp cp -fr  /usr/lib/ruby/gems/1.8/gems/stomp-1.3.2/lib/stomp.rb   /usr/lib/ruby/site_ruby/1.8/mcollective/connector/ 来自为知笔记(Wiz) 原文地址:htt

spring mvc 报错汇总--点滴。。

1....identifier of an instance of org.szgzw.ent.profile.baseinfo.enterprise.EnterpriseEntity was altered from 2c90e4da49514c750149515eb56f0003 to undefined; nested exception is org.hibernate.HibernateException: identifier of an instance of org.szgzw.