pengmingde / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 0 forks source link

masterha_check_repl error when relay_log_info_repository=table #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

when i executed  "masterha_check_repl --conf=/etc/masterha/app1/app1.cnf"
i got some errors like followings:

Fri Jun  6 15:58:12 2014 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Fri Jun  6 15:58:12 2014 - [info] Reading application default configurations 
from /etc/masterha/app1/app1.cnf..
Fri Jun  6 15:58:12 2014 - [info] Reading server configurations from 
/etc/masterha/app1/app1.cnf..
Fri Jun  6 15:58:12 2014 - [info] MHA::MasterMonitor version 0.55.
Fri Jun  6 15:58:12 2014 - [error][/usr/share/perl5/vendor_perl/MHA/Server.pm, 
ln241]  Getting relay log directory or current relay logfile from replication 
table failed on 192.168.100.55(192.168.100.55:3306)!
Fri Jun  6 15:58:12 2014 - 
[error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln386] Error happend 
on checking configurations.  at 
/usr/share/perl5/vendor_perl/MHA/ServerManager.pm line 269
Fri Jun  6 15:58:12 2014 - 
[error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln482] Error 
happened on monitoring servers.
Fri Jun  6 15:58:12 2014 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

======================================

mha version :  node-0.54 manager-0.55
mysql version : 5.6.15-rel63.0-log
OS version : centos 6.4 x_85 64

1,some parameters in my.cnf on both master and slave

 relay_log_info_repository=TABLE
 master_info_repository=TABLE

2, MHA app1.cnf 

[server default]
manager_log=/var/log/managemha.log
manager_workdir=/var/log/managemha
master_ip_failover_script="/usr/local/bin/master_ip_failover"
master_ip_online_change_script="/usr/local/bin/master_ip_online_change"
password=xxxooo
ping_interval=4
ssh_connection_timeout=15
ping_type=CONNECT
remote_workdir=/data/nodemha
repl_password=xxxx
repl_user=repl
ssh_port=22
ssh_user=root
user=root

[server1]
candidate_master=1
ignore_fail=1
hostname=192.168.100.55
master_binlog_dir=/data/percona-data-3307
port=3307

[server2]
candidate_master=1
ignore_fail=1
hostname=192.168.100.55
master_binlog_dir=/data/percona-data-3306
port=3306

192.168.100.55:3306 is the master while 192.168.100.55:3307 is the slave. 

look this(192.168.100.55:3307):

(user:root  time: 11:44 port: 3307)[db: (none)]select * from 
mysql.slave_relay_log_info;
+-----------------+--------------------------+---------------+------------------
+----------------+-----------+-------------------+----+
| Number_of_lines | Relay_log_name           | Relay_log_pos | Master_log_name  
| Master_log_pos | Sql_delay | Number_of_workers | Id |
+-----------------+--------------------------+---------------+------------------
+----------------+-----------+-------------------+----+
|               7 | ./mysql-relay-bin.000002 |      24298857 | mysql-bin.000008 
|       52881234 |         0 |                 0 |  1 |
+-----------------+--------------------------+---------------+------------------
+----------------+-----------+-------------------+----+

need your help

thanks !

Original issue reported on code.google.com by freedom3...@gmail.com on 9 Jun 2014 at 2:02

GoogleCodeExporter commented 9 years ago
Would you please show the result of the following command on the master 
(192.168.100.55:3306)?

SHOW SLAVE STATUS

The error code path is entered when parsing slave servers only. So I assume on 
3306 slave definition exists. If it exists, would you please remove slave 
definition by RESET SLAVE ALL and try again?

Original comment by Yoshinor...@gmail.com on 9 Jun 2014 at 4:08

GoogleCodeExporter commented 9 years ago
after testing ,i found that if set  relay_log_info_repository=TABLE and 
master_info_repository=TABLE   MHA also check table mysql.slave_relay_log_info 
on master ,so when mha found there is nothing in mysql.slave_relay_log_info 
then produces errors . 

solution:
modify my.cnf on the master (192.168.100.55:3306)
 # relay_log_info_repository=TABLE 
 # master_info_repository=TABLE
then restart master

everything is ok 

thank you !

Original comment by freedom3...@gmail.com on 9 Jun 2014 at 6:26

GoogleCodeExporter commented 9 years ago
I met this issue recently, maybe a master should not specialize the two slave 
parameters, so remove them in my.cnf is correct solution,  mha-0.56 still has 
the issue.

Original comment by wanggon...@gmail.com on 5 Jan 2015 at 7:49