What steps will reproduce the problem?
1. Get lastest(on 17.12.2012) code by git from
https://github.com/yoshinorim/mha4mysql-manager.git
2. make && install
perl Makefile.PL PREFIX=/usr
make
make install
3.my mha conf file
##
# init users and dirs
##
# list of servers
[server1]
hostname=us1
ip=172.16.50.11
candidate_master=1
ignore_fail=1
[server2]
hostname=us4
ip=172.16.50.14
candidate_master=1
ignore_fail=1
[server3]
ignore_fail=1
hostname=us3
ip=172.16.50.13
candidate_master=1
4.
Check that mysql is stopped on server 172.16.50.13, and run on other
Run mha-manager
masterha_manager --ignore_fail_on_start=1 --conf=/home/mha4mysql/etc/app1.cnf
What is the expected output?
Mha should start and notice that US3 is dead and then continue work
What do you see instead?
Mha gone out with error
############
############
Mon Dec 17 10:58:08 2012 - [warning] Global configuration file
/etc/masterha_default.cnf not found. Skipping.
Mon Dec 17 10:58:08 2012 - [info] Reading application default configurations
from /home/mha4mysql/etc/app1.cnf..
Mon Dec 17 10:58:08 2012 - [info] Reading server configurations from
/home/mha4mysql/etc/app1.cnf..
Mon Dec 17 10:58:08 2012 - [info] MHA::MasterMonitor version 0.55.
Mon Dec 17 10:58:08 2012 - [info] Dead Servers:
Mon Dec 17 10:58:08 2012 - [info] us3(172.16.50.13:3306)
Mon Dec 17 10:58:08 2012 - [info] Alive Servers:
Mon Dec 17 10:58:08 2012 - [info] funky(172.16.50.11:3306)
Mon Dec 17 10:58:08 2012 - [info] us4(172.16.50.14:3306)
Mon Dec 17 10:58:08 2012 - [info] Alive Slaves:
Mon Dec 17 10:58:08 2012 - [info] funky(172.16.50.11:3306)
Version=5.5.28-MariaDB-log (oldest major version between slaves) log-bin:enabled
Mon Dec 17 10:58:08 2012 - [info] Replicating from
172.16.50.14(172.16.50.14:3306)
Mon Dec 17 10:58:08 2012 - [info] Primary candidate for the new Master
(candidate_master is set)
Mon Dec 17 10:58:08 2012 - [info] Current Alive Master: us4(172.16.50.14:3306)
Mon Dec 17 10:58:08 2012 - [info] Checking slave configurations..
Mon Dec 17 10:58:08 2012 - [info] read_only=1 is not set on slave
funky(172.16.50.11:3306).
Mon Dec 17 10:58:08 2012 - [warning] relay_log_purge=0 is not set on slave
funky(172.16.50.11:3306).
Mon Dec 17 10:58:08 2012 - [info] Checking replication filtering settings..
Mon Dec 17 10:58:08 2012 - [info] binlog_do_db= testdb, binlog_ignore_db=
Mon Dec 17 10:58:08 2012 - [info] Replication filtering check ok.
Mon Dec 17 10:58:08 2012 - [info] Starting SSH connection tests..
Mon Dec 17 10:58:09 2012 - [info] All SSH connection tests passed successfully.
Mon Dec 17 10:58:09 2012 - [info] Checking MHA Node version..
Mon Dec 17 10:58:09 2012 - [info] Version check ok.
Mon Dec 17 10:58:09 2012 - [error][/usr/share/perl/5.14/MHA/ServerManager.pm,
ln443] Server us3(172.16.50.13:3306) is dead, but must be alive! Check server
settings.
Mon Dec 17 10:58:09 2012 - [error][/usr/share/perl/5.14/MHA/MasterMonitor.pm,
ln386] Error happend on checking configurations. at
/usr/share/perl/5.14/MHA/MasterMonitor.pm line 363
Mon Dec 17 10:58:09 2012 - [error][/usr/share/perl/5.14/MHA/MasterMonitor.pm,
ln482] Error happened on monitoring servers.
Mon Dec 17 10:58:09 2012 - [info] Got exit code 1 (Not master dead).
###########
###########
Please provide any additional information below.
I am not ace in perl, but i try to debug error.
I add printf in MasterMonitor.pm after section "GetOptions(" in "sub main "
it prints evrytime 0 and not depend what i write in arg when execute
masterha_manager --ignore_fail_on_start=1 --conf=/home/mha4mysql/etc/app1.cnf
or
masterha_manager --ignore_fail_on_start=0 --conf=/home/mha4mysql/etc/app1.cnf
I found what need to change
diff --git a/lib/MHA/MasterMonitor.pm b/lib/MHA/MasterMonitor.pm
index 71945de..ff80c89 100644
--- a/lib/MHA/MasterMonitor.pm
+++ b/lib/MHA/MasterMonitor.pm
@@ -636,7 +636,7 @@ sub main {
'manager_log=s' => \$g_logfile,
'skip_ssh_check' => \$g_skip_ssh_check, # for testing
'skip_check_ssh' => \$g_skip_ssh_check,
- 'ignore_fail_on_start' => \$g_ignore_fail_on_start,
+ 'ignore_fail_on_start=i' => \$g_ignore_fail_on_start,
);
setpgrp( 0, $$ ) unless ($g_interactive);
After that mha-manager works with argument correctly and as expected
Check it please