MASTERHA_CHECK_REPL Error Summary

Source: Internet
Author: User

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

There are two main causes for the following error :

1.mysql installation with the source code installation, resulting in the MySQL directory and MHA default directory is inconsistent. The solution uses Ln-s to make the related soft connection. Note: My MySQL database is installed with the MySQL user, MHA is installed with the root user, if installed under the same user do not know whether to avoid such problems

2.candidate_master the corresponding user rights are insufficient.

The following is excerpted from the network

Error Record 1:

[Email protected] ~]# MASTERHA_CHECK_REPL--CONF=/ETC/MASTERHA/APP1.CNF
Tue APR 7 22:31:06-[WARNING] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Tue APR 7 22:31:07-[INFO] Reading application default configuration from/etc/masterha/app1.cnf.
Tue APR 7 22:31:07-[INFO] Reading server configuration from/etc/masterha/app1.cnf.
Tue APR 7 22:31:07-[INFO] mha::mastermonitor version 0.56.
Tue APR 7 22:31:07-[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-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln424] error happened on checking Configura tions. At/usr/local/share/perl5/mha/servermanager.pmline 315
Tue APR 7 22:31:07-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln523] error happened on monitoring servers .
Tue APR 7 22:31:07-[INFO] Got exit code 1 (not master dead).

MySQL Replication Health is not ok!

[Email protected] ~]#

Workaround: Above 192.168.52.130, vim/etc/my.cnf, add in

Relay-log=/home/data/mysql/binlog/mysql-relay-bin
Then restart MySQL and then reset the slave connection.
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, it's done.

Error Record 2
[Email protected] perl]# MASTERHA_CHECK_REPL--CONF=/ETC/MASTERHA/APP1.CNF
Thu APR 9 00:54:32-[WARNING] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Thu APR 9 00:54:32-[INFO] Reading application default configuration from/etc/masterha/app1.cnf.
Thu APR 9 00:54:32-[INFO] Reading server configuration from/etc/masterha/app1.cnf.
Thu APR 9 00:54:32-[INFO] mha::mastermonitor version 0.56.
Thu APR 9 00:54:32-[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-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln424] error happened on checking Configura tions. AT/USR/LOCAL/SHARE/PERL5/MHA/SERVERMANAGER.PM Line 315
Thu APR 9 00:54:32-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln523] error happened on monitoring servers .
Thu APR 9 00:54:32-[INFO] Got exit code 1 (not master dead).

MySQL Replication Health is not ok!

[Email protected] perl]#

Workaround:

/ETC/MASTERHA/APP1.CNF file inside the parameter configuration, user and Repl_user are MySQL account, need to be created, here is only created Repl_user and not create a good user account:
User=manager
password=manager_1234
Repl_user=repl
repl_password=repl_1234

On the MySQL node, create a "manager Manager" account that allows the manager to access the database, primarily for show Slavestatus,reset SLAVE; So you need to execute the following command:
GRANT super,reload,replicationclient,select On * * to [e-mail protected] ' 192.168.52.% ' identified by ' manager_1234 ';

Error Logging 3
[Email protected] ~]# MASTERHA_CHECK_REPL--CONF=/ETC/MASTERHA/APP1.CNF
Thu APR 9 23:09:05-[WARNING] Global configuration file/etc/masterha_default.cnf not found. Skipping.
Thu APR 9 23:09:05-[INFO] Reading application default configuration from/etc/masterha/app1.cnf.
Thu APR 9 23:09:05-[INFO] Reading server configuration from/etc/masterha/app1.cnf.
Thu APR 9 23:09:05-[INFO] mha::mastermonitor version 0.56.
Thu APR 9 23:09:05-[error][/usr/local/share/perl5/mha/servermanager.pm,ln781] multi-master configuration is detected, but both or more Masters Areeither writable (Read-only are not set) or dead! Check configurations Fordetails. Master configurations is 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-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln424] error happened on checking Configura tions. AT/USR/LOCAL/SHARE/PERL5/MHA/MASTERMONITOR.PM Line 326
Thu APR 9 23:09:05-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln523] error happened on monitoring servers .
Thu APR 9 23:09:05-[INFO] Got exit code 1 (not master dead).

MySQL Replication Health is not ok!

[Email protected] ~]#

Workaround:

mysql> set global Read_only=1;
Query OK, 0 rows Affected (0.00 sec)
Mysql>

Error Record 4
Thu APR 9 23:54:32-[info] Checking SSH publickey authentication andchecking Recovery script configurations on all a Live slave servers.
Thu APR 9 23:54:32-[info] executing command:apply_diff_relay_logs--command=test--slave_user= ' manager '--slave_ho st=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-[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-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln205] Slaves settings Check failed!
Thu APR 9 23:54:32-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln413] Slave configuration failed.
Thu APR 9 23:54:32-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln424] error happened on checking Configura tions. At/usr/local/bin/masterha_check_repl Line 48
Thu APR 9 23:54:32-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln523] error happened on monitoring servers .
Thu APR 9 23:54:32-[INFO] Got exit code 1 (not master dead).
MySQL Replication Health is not ok!

[Email protected] ~]#

Workaround (all nodes are executed once):
[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

Error Record 5
Thu APR 9 23:57:24-[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-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln205] Slaves settings Check failed!
Thu APR 9 23:57:24-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln413] Slave configuration failed.
Thu APR 9 23:57:24-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln424] error happened on checking Configura tions. At/usr/local/bin/masterha_check_repl Line 48
Thu APR 9 23:57:24-[error][/usr/local/share/perl5/mha/mastermonitor.pm,ln523] error happened on monitoring servers .
Thu APR 9 23:57:24-[INFO] Got exit code 1 (not master dead).

MySQL Replication Health is not ok!

Workaround (all nodes are executed once):
Ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql


Error Record 6 (the Switch machine user rights do not match):
Fri APR 00:58:36-[info] executing command:apply_diff_relay_logs--command=test--slave_user= ' manager '--slave_h ost=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 00:58:36-[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 00:58:37-[error][/usr/local/share/perl5/mha/mastermonitor.pm, ln205] slaves Settingscheck failed!
Fri Apr 00:58:37-[error][/usr/local/share/perl5/mha/mastermonitor.pm, ln413] Slave configurationfailed.
Fri Apr 00:58:37-[error][/usr/local/share/perl5/mha/mastermonitor.pm, ln424] Error happened onchecking Configurations. At/usr/local/bin/masterha_check_repl Line 48
Fri Apr 00:58:37-[error][/usr/local/share/perl5/mha/mastermonitor.pm, ln523] Error happened onmonitoring Servers.
Fri APR 00:58:37-[INFO] Got ExitCode 1 (not master dead).


MySQL Replication Health is not ok!

Workaround:

Execute the following authorization statement sql:
GRANT Create,insert,update,delete,drop on*.* to [email protected] ' 192.168.52.% ';

MASTERHA_CHECK_REPL Error Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.