mctaek / mysql-master-ha

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

Testing mysql connection and privileges..sh: mysql: command not found #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

1. Try start masterha_check_repl --conf=/etc/app1.cnf
2. Get this error:

[root@Manager ~]# masterha_check_repl --conf=/etc/masterha_default.cnf 
Thu May 24 14:32:05 2012 - [info] Reading default configuratoins from 
/etc/masterha_default.cnf..
Thu May 24 14:32:05 2012 - [info] Reading application default configurations 
from /etc/masterha_default.cnf..
Thu May 24 14:32:05 2012 - [info] Reading server configurations from 
/etc/masterha_default.cnf..
Thu May 24 14:32:05 2012 - [info] MHA::MasterMonitor version 0.52.
Thu May 24 14:32:05 2012 - [info] Dead Servers:
Thu May 24 14:32:05 2012 - [info] Alive Servers:
Thu May 24 14:32:05 2012 - [info]   Master(192.168.114.132:3306)
Thu May 24 14:32:05 2012 - [info]   Slave(192.168.114.131:3306)
Thu May 24 14:32:05 2012 - [info]   Slave2(192.168.114.134:3306)
Thu May 24 14:32:05 2012 - [info] Alive Slaves:
Thu May 24 14:32:05 2012 - [info]   Slave(192.168.114.131:3306)  
Version=5.5.14-log (oldest major version between slaves) log-bin:enabled
Thu May 24 14:32:05 2012 - [info]     Replicating from 
192.168.114.132(192.168.114.132:3306)
Thu May 24 14:32:05 2012 - [info]   Slave2(192.168.114.134:3306)  
Version=5.5.14-log (oldest major version between slaves) log-bin:enabled
Thu May 24 14:32:05 2012 - [info]     Replicating from 
192.168.114.132(192.168.114.132:3306)
Thu May 24 14:32:05 2012 - [info] Current Alive Master: 
Master(192.168.114.132:3306)
Thu May 24 14:32:05 2012 - [info] Checking slave configurations..
Thu May 24 14:32:05 2012 - [warning]  read_only=1 is not set on slave 
Slave(192.168.114.131:3306).
Thu May 24 14:32:05 2012 - [warning]  relay_log_purge=0 is not set on slave 
Slave(192.168.114.131:3306).
Thu May 24 14:32:05 2012 - [warning]  read_only=1 is not set on slave 
Slave2(192.168.114.134:3306).
Thu May 24 14:32:05 2012 - [warning]  relay_log_purge=0 is not set on slave 
Slave2(192.168.114.134:3306).
Thu May 24 14:32:05 2012 - [info] Checking replication filtering settings..
Thu May 24 14:32:05 2012 - [info]  binlog_do_db= EcommerceDB, binlog_ignore_db= 
information_schema,mysql,performance_schema,test
Thu May 24 14:32:05 2012 - [info]  Replication filtering check ok.
Thu May 24 14:32:05 2012 - [info] Starting SSH connection tests..
Thu May 24 14:32:07 2012 - [info] All SSH connection tests passed successfully.
Thu May 24 14:32:07 2012 - [info] Checking MHA Node version..
Thu May 24 14:32:08 2012 - [info]  Version check ok.
Thu May 24 14:32:08 2012 - [info] Checking SSH publickey authentication and 
checking recovery script configurations on the current master..
Thu May 24 14:32:08 2012 - [info]   Executing command: save_binary_logs 
--command=test --start_file=ecommerce-bin.000001 --start_pos=4 
--binlog_dir=/data/ecommerce_bin_log 
--output_file=/var/log/masterha/app1/save_binary_logs_test 
--manager_version=0.52 
Thu May 24 14:32:08 2012 - [info]   Connecting to root@Master(Master).. 
  Creating /var/log/masterha/app1 if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /data/ecommerce_bin_log, up to ecommerce-bin.000001
Thu May 24 14:32:09 2012 - [info] Master setting check done.
Thu May 24 14:32:09 2012 - [info] Checking SSH publickey authentication and 
checking recovery script configurations on all alive slave servers..
Thu May 24 14:32:09 2012 - [info]   Executing command : apply_diff_relay_logs 
--command=test --slave_user=root --slave_host=Slave --slave_ip=192.168.114.131 
--slave_port=3306 --workdir=/var/log/masterha/app1 --target_version=5.5.14-log 
--manager_version=0.52 --relay_log_info=/usr/local/mysql/data/relay-log.info  
--slave_pass=xxx
Thu May 24 14:32:09 2012 - [info]   Connecting to root@192.168.114.131(Slave).. 
  Checking slave recovery environment settings..
    Opening /usr/local/mysql/data/relay-log.info ... ok.
    Relay log found at /data/ecommerce_relay_log, up to ecommerce-relay-bin.000003
    Temporary relay log file is /data/ecommerce_relay_log/ecommerce-relay-bin.000003
    Testing mysql connection and privileges..sh: mysql: command not found
mysql command failed with rc 127:0!
 at /usr/bin/apply_diff_relay_logs line 315
        main::check() called at /usr/bin/apply_diff_relay_logs line 429
        eval {...} called at /usr/bin/apply_diff_relay_logs line 409
        main::main() called at /usr/bin/apply_diff_relay_logs line 97
Thu May 24 14:32:09 2012 - 
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln129] Slaves 
settings check failed!
Thu May 24 14:32:09 2012 - 
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln304] Slave 
configuration failed.
Thu May 24 14:32:09 2012 - 
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln315] Error 
happend on checking configurations.  at /usr/bin/masterha_check_repl line 48
Thu May 24 14:32:09 2012 - 
[error][/usr/lib/perl5/site_perl/5.8.8/MHA/MasterMonitor.pm, ln396] Error 
happened on monitoring servers.
Thu May 24 14:32:09 2012 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

3. This is my /etc/app1.cnf

manager_log=/var/log/masterha/app1/app1.log
manager_workdir=/var/log/masterha/app1
user=root
password=123456
remote_workdir=/data/ecommerce_bin_log

[server1]
hostname=Master

[server2]
hostname=Slave
candidate_master=1

[server3]
hostname=Slave2

Pls help me explain why does this error happen?

OS:    CentOS Release 5.2
Mysql: 5.5.14( build from source )
basedir: /usr/local/mysql
datadir: /usr/local/mysql/data

Pls help me check and give me an advice as soon as possible

Thanks,
dba.truyennt@gmail.com

Original issue reported on code.google.com by dba.truy...@gmail.com on 24 May 2012 at 7:50

GoogleCodeExporter commented 8 years ago
hi all,
    can anyone help me?
Please help me fixed it soon

Original comment by dba.truy...@gmail.com on 29 May 2012 at 3:58

GoogleCodeExporter commented 8 years ago
MHA runs mysql command via SSH if needed. If you get same error by "ssh 
mysql_server_host 'mysql --version'", please try to install MySQL client (mysql 
and mysqlbinlog) to /usr/bin etc.

Original comment by Yoshinor...@gmail.com on 29 May 2012 at 4:13

GoogleCodeExporter commented 8 years ago
hi Yoshinor...@gmail.com,
i already check and every thing seem ok. but this error still happen. Now i 
dont know what thing should i check.

Please help me soon.

Thanks & Best Regards,
dba.truyennt

Original comment by dba.truy...@gmail.com on 6 Jun 2012 at 9:14

GoogleCodeExporter commented 8 years ago
Hi~~Yoshinor
My system is debian,A total of four servers,one master and the other is 
slave.
master:10.10.1.109
slave1:10.10.1.193
slave2:10.10.1.194
slave3+mha_manage:10.10.1.195

My Database master-slave synchronization configuration is correct

and this is my /etc/app1.cnf

[server default]
# mysql user and password
user=root
password=0ps.iz3n3
ssh_user=ops

repl_user=rep
repl_password=bm5123
# working directory on the manager
manager_workdir=/var/log/masterha/app1
# working directory on MySQL servers
remote_workdir=/var/log/masterha/app1

[server1]
hostname=10.10.1.109

[server2]
hostname=10.10.1.193

[server3]
hostname=10.10.1.194

When I run this command

ops@B5M-D5:~$ masterha_check_ssh --conf=/etc/app1.cnf 
Fri Jan  4 18:43:48 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Fri Jan  4 18:43:48 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Fri Jan  4 18:43:48 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Fri Jan  4 18:43:48 2013 - [info] Starting SSH connection tests..
Fri Jan  4 18:43:50 2013 - [debug] 
Fri Jan  4 18:43:48 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.109(10.10.1.109:22) to ops@10.10.1.193(10.10.1.193:22)..
Fri Jan  4 18:43:49 2013 - [debug]   ok.
Fri Jan  4 18:43:49 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.109(10.10.1.109:22) to ops@10.10.1.194(10.10.1.194:22)..
Fri Jan  4 18:43:49 2013 - [debug]   ok.
Fri Jan  4 18:43:50 2013 - [debug] 
Fri Jan  4 18:43:49 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.193(10.10.1.193:22) to ops@10.10.1.109(10.10.1.109:22)..
Fri Jan  4 18:43:49 2013 - [debug]   ok.
Fri Jan  4 18:43:49 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.193(10.10.1.193:22) to ops@10.10.1.194(10.10.1.194:22)..
Fri Jan  4 18:43:49 2013 - [debug]   ok.
Fri Jan  4 18:43:50 2013 - [debug] 
Fri Jan  4 18:43:49 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.194(10.10.1.194:22) to ops@10.10.1.109(10.10.1.109:22)..
Fri Jan  4 18:43:50 2013 - [debug]   ok.
Fri Jan  4 18:43:50 2013 - [debug]  Connecting via SSH from 
ops@10.10.1.194(10.10.1.194:22) to ops@10.10.1.193(10.10.1.193:22)..
Fri Jan  4 18:43:50 2013 - [debug]   ok.
Fri Jan  4 18:43:50 2013 - [info] All SSH connection tests passed successfully.

But when I run this command

ops@B5M-D5:~$ masterha_check_repl --conf=/etc/app1.cnf 
Fri Jan  4 19:00:25 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Fri Jan  4 19:00:25 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Fri Jan  4 19:00:25 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Fri Jan  4 19:00:25 2013 - [info] MHA::MasterMonitor version 0.53.
Fri Jan  4 19:00:25 2013 - [info] Dead Servers:
Fri Jan  4 19:00:25 2013 - [info] Alive Servers:
Fri Jan  4 19:00:25 2013 - [info]   10.10.1.109(10.10.1.109:3306)
Fri Jan  4 19:00:25 2013 - [info]   10.10.1.193(10.10.1.193:3306)
Fri Jan  4 19:00:25 2013 - [info]   10.10.1.194(10.10.1.194:3306)
Fri Jan  4 19:00:25 2013 - [info] Alive Slaves:
Fri Jan  4 19:00:25 2013 - [info]   10.10.1.193(10.10.1.193:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Fri Jan  4 19:00:25 2013 - [info]     Replicating from 
10.10.1.109(10.10.1.109:3306)
Fri Jan  4 19:00:25 2013 - [info]   10.10.1.194(10.10.1.194:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Fri Jan  4 19:00:25 2013 - [info]     Replicating from 
10.10.1.109(10.10.1.109:3306)
Fri Jan  4 19:00:25 2013 - [info] Current Alive Master: 
10.10.1.109(10.10.1.109:3306)
Fri Jan  4 19:00:25 2013 - [info] Checking slave configurations..
Fri Jan  4 19:00:25 2013 - [info]  read_only=1 is not set on slave 
10.10.1.193(10.10.1.193:3306).
Fri Jan  4 19:00:25 2013 - [warning]  relay_log_purge=0 is not set on slave 
10.10.1.193(10.10.1.193:3306).
Fri Jan  4 19:00:25 2013 - [info]  read_only=1 is not set on slave 
10.10.1.194(10.10.1.194:3306).
Fri Jan  4 19:00:25 2013 - [warning]  relay_log_purge=0 is not set on slave 
10.10.1.194(10.10.1.194:3306).
Fri Jan  4 19:00:25 2013 - [info] Checking replication filtering settings..
Fri Jan  4 19:00:25 2013 - [info]  binlog_do_db= , binlog_ignore_db= 
Fri Jan  4 19:00:25 2013 - [info]  Replication filtering check ok.
Fri Jan  4 19:00:25 2013 - [info] Starting SSH connection tests..
cat: /var/log/masterha/app1/10.10.1.109_22_ssh_check.log: No such file or 
directory
Fri Jan  4 19:00:25 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63] 
cat: /var/log/masterha/app1/10.10.1.193_22_ssh_check.log: No such file or 
directory
Fri Jan  4 19:00:26 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63] 
cat: /var/log/masterha/app1/10.10.1.194_22_ssh_check.log: No such file or 
directory
Fri Jan  4 19:00:26 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63] 
Fri Jan  4 19:00:26 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln383] Error happend on checking configurations. SSH Configuration Check Failed!
 at /usr/share/perl5/MHA/MasterMonitor.pm line 339
Fri Jan  4 19:00:26 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln478] Error happened on monitoring servers.
Fri Jan  4 19:00:26 2013 - [info] Got exit code 1 (Not master dead).

Can u tell me why?

i already check and every thing seem ok. but this error still happen

Original comment by yanq...@b5m.com on 4 Jan 2013 at 4:41

GoogleCodeExporter commented 8 years ago
I am not use root user to run 

because i have not passwd

but i have sudo Competence

Original comment by yanq...@b5m.com on 5 Jan 2013 at 12:38

GoogleCodeExporter commented 8 years ago
Help me......Thanks

Original comment by yanq...@b5m.com on 5 Jan 2013 at 12:48

GoogleCodeExporter commented 8 years ago
Please add "log_level=debug" in /etc/app1.cnf [server default] section and show 
me the logs. And please retry a few times and check it repeats.

Original comment by Yoshinor...@gmail.com on 5 Jan 2013 at 1:29

GoogleCodeExporter commented 8 years ago
Hi~~Yoshinor
I admire you very much, but I think perhaps permission problem, because my 
directory for mysql data is / var / lib /mysql 

and this directory is 700 permissions

and I know /etc/app1.cnf ssh-user configuration file inside must have read 
permissions for relay-log.info

In my test environment,I have root passwd,I run this command 
masterha_check_repl --conf=/etc/app1.cnf is so easy,Include all of the high 
availability test, the standby switch is successful

but when i use ops user,Although I add it to / etc / sudoers, also have root 
privileges,but run masterha_check_repl - conf = / etc/app1.cnf always fails

I'll try to / var / lib / mysql directory permissions to 755 tomorrow!

If have any problem,I will ask u for help!

Thank you very much

Original comment by yanq...@b5m.com on 5 Jan 2013 at 4:44

GoogleCodeExporter commented 8 years ago
hi~~Yoshinor

The problem is not resolved

This is the error message
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++
ops@mha:~$ masterha_check_repl --conf=/etc/app1.cnf
Sat Jan  5 21:43:10 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Sat Jan  5 21:43:10 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Sat Jan  5 21:43:10 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Sat Jan  5 21:43:10 2013 - [info] MHA::MasterMonitor version 0.53.
Sat Jan  5 21:43:10 2013 - [debug] Connecting to servers..
Sat Jan  5 21:43:10 2013 - [debug]  Connected to: 
192.168.202.128(192.168.202.128:3306), user=root
Sat Jan  5 21:43:10 2013 - [debug]  Connected to: 
192.168.202.129(192.168.202.129:3306), user=root
Sat Jan  5 21:43:10 2013 - [debug]  Connected to: 
192.168.202.130(192.168.202.130:3306), user=root
Sat Jan  5 21:43:10 2013 - [debug]  Comparing MySQL versions..
Sat Jan  5 21:43:10 2013 - [debug]   Comparing MySQL versions done.
Sat Jan  5 21:43:10 2013 - [debug] Connecting to servers done.
Sat Jan  5 21:43:10 2013 - [info] Dead Servers:
Sat Jan  5 21:43:10 2013 - [info] Alive Servers:
Sat Jan  5 21:43:10 2013 - [info]   192.168.202.128(192.168.202.128:3306)
Sat Jan  5 21:43:10 2013 - [info]   192.168.202.129(192.168.202.129:3306)
Sat Jan  5 21:43:10 2013 - [info]   192.168.202.130(192.168.202.130:3306)
Sat Jan  5 21:43:10 2013 - [info] Alive Slaves:
Sat Jan  5 21:43:10 2013 - [info]   192.168.202.129(192.168.202.129:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 21:43:10 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 21:43:10 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 21:43:10 2013 - [info]   192.168.202.130(192.168.202.130:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 21:43:10 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 21:43:10 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 21:43:10 2013 - [info] Current Alive Master: 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 21:43:10 2013 - [info] Checking slave configurations..
Sat Jan  5 21:43:10 2013 - [info]  read_only=1 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 21:43:10 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 21:43:10 2013 - [info]  read_only=1 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 21:43:10 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 21:43:10 2013 - [info] Checking replication filtering settings..
Sat Jan  5 21:43:10 2013 - [info]  binlog_do_db= , binlog_ignore_db=
Sat Jan  5 21:43:10 2013 - [info]  Replication filtering check ok.
Sat Jan  5 21:43:10 2013 - [info] Starting SSH connection tests..
Sat Jan  5 21:43:10 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
Sat Jan  5 21:43:11 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
Sat Jan  5 21:43:11 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
Sat Jan  5 21:43:11 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln383] Error happend on checking configurations. SSH Configuration Check Failed!
 at /usr/share/perl5/MHA/MasterMonitor.pm line 339
Sat Jan  5 21:43:11 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln478] Error happened on monitoring servers.
Sat Jan  5 21:43:11 2013 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

Original comment by yanq...@b5m.com on 6 Jan 2013 at 1:32

GoogleCodeExporter commented 8 years ago
This is my /etc/app1.cnf
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[server default]
log_level=debug
# mysql user and password
user=root
password=jinyan123
ssh_user=ops

repl_user=rep
repl_password=jinyan123
# working directory on the manager
manager_workdir=/var/log/masterha/app1
# manager log file
manager_log=/var/log/masterha/app1/app1.log
# working directory on MySQL servers
remote_workdir=/var/log/masterha/app1
[server1]
hostname=192.168.202.128
[server2]
hostname=192.168.202.129
[server3]
hostname=192.168.202.130

Original comment by yanq...@b5m.com on 6 Jan 2013 at 1:33

GoogleCodeExporter commented 8 years ago
It is likely that SSH public key authentication w/o passphrase is not properly 
configured.

Please check ssh connections manually between manager and server1-3.
i.e:
ssh 192.168.202.128
ssh 192.168.202.129 "ssh manager_host"

Original comment by Yoshinor...@gmail.com on 6 Jan 2013 at 1:56

GoogleCodeExporter commented 8 years ago
Thank you,Yoshinor

when I use ops user,and run this command

ops@mha:~$ masterha_check_ssh --conf=/etc/app1.cnf
Sat Jan  5 23:13:27 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Sat Jan  5 23:13:27 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Sat Jan  5 23:13:27 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Sat Jan  5 23:13:27 2013 - [info] Starting SSH connection tests..
Sat Jan  5 23:13:28 2013 - [debug]
Sat Jan  5 23:13:27 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to ops@192.168.20                       
                            2.129(192.168.202.129:22)..
Sat Jan  5 23:13:27 2013 - [debug]   ok.
Sat Jan  5 23:13:27 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to ops@192.168.20                       
                            2.130(192.168.202.130:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:28 2013 - [debug]
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to ops@192.168.20                       
                            2.128(192.168.202.128:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to ops@192.168.20                       
                            2.130(192.168.202.130:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [debug]
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to ops@192.168.20                       
                            2.128(192.168.202.128:22)..
Sat Jan  5 23:13:29 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to ops@192.168.20                       
                            2.129(192.168.202.129:22)..
Sat Jan  5 23:13:29 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [info] All SSH connection tests passed successfully.
ops@mha:~$

Original comment by yanq...@b5m.com on 6 Jan 2013 at 2:57

GoogleCodeExporter commented 8 years ago
But check mysql replication

And in fact,mysql replication is ok

 ops@mha:~$ masterha_check_ssh --conf=/etc/app1.cnf
Sat Jan  5 23:13:27 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Sat Jan  5 23:13:27 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Sat Jan  5 23:13:27 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Sat Jan  5 23:13:27 2013 - [info] Starting SSH connection tests..
Sat Jan  5 23:13:28 2013 - [debug]
Sat Jan  5 23:13:27 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to ops@192.168.20                       
                            2.129(192.168.202.129:22)..
Sat Jan  5 23:13:27 2013 - [debug]   ok.
Sat Jan  5 23:13:27 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to ops@192.168.20                       
                            2.130(192.168.202.130:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:28 2013 - [debug]
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to ops@192.168.20                       
                            2.128(192.168.202.128:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to ops@192.168.20                       
                            2.130(192.168.202.130:22)..
Sat Jan  5 23:13:28 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [debug]
Sat Jan  5 23:13:28 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to ops@192.168.20                       
                            2.128(192.168.202.128:22)..
Sat Jan  5 23:13:29 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to ops@192.168.20                       
                            2.129(192.168.202.129:22)..
Sat Jan  5 23:13:29 2013 - [debug]   ok.
Sat Jan  5 23:13:29 2013 - [info] All SSH connection tests passed successfully.
ops@mha:~$ masterha_check_repl --conf=/etc/app1.cnf
Sat Jan  5 23:16:47 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Sat Jan  5 23:16:47 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Sat Jan  5 23:16:47 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Sat Jan  5 23:16:47 2013 - [info] MHA::MasterMonitor version 0.53.
Sat Jan  5 23:16:47 2013 - [debug] Connecting to servers..
Sat Jan  5 23:16:47 2013 - [debug]  Connected to: 
192.168.202.128(192.168.202.128:3306), user=root
Sat Jan  5 23:16:47 2013 - [debug]  Connected to: 
192.168.202.129(192.168.202.129:3306), user=root
Sat Jan  5 23:16:47 2013 - [debug]  Connected to: 
192.168.202.130(192.168.202.130:3306), user=root
Sat Jan  5 23:16:47 2013 - [debug]  Comparing MySQL versions..
Sat Jan  5 23:16:47 2013 - [debug]   Comparing MySQL versions done.
Sat Jan  5 23:16:47 2013 - [debug] Connecting to servers done.
Sat Jan  5 23:16:47 2013 - [info] Dead Servers:
Sat Jan  5 23:16:47 2013 - [info] Alive Servers:
Sat Jan  5 23:16:47 2013 - [info]   192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:16:47 2013 - [info]   192.168.202.129(192.168.202.129:3306)
Sat Jan  5 23:16:47 2013 - [info]   192.168.202.130(192.168.202.130:3306)
Sat Jan  5 23:16:47 2013 - [info] Alive Slaves:
Sat Jan  5 23:16:47 2013 - [info]   192.168.202.129(192.168.202.129:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 23:16:47 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 23:16:47 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:16:47 2013 - [info]   192.168.202.130(192.168.202.130:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 23:16:47 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 23:16:47 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:16:47 2013 - [info] Current Alive Master: 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:16:47 2013 - [info] Checking slave configurations..
Sat Jan  5 23:16:47 2013 - [info]  read_only=1 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 23:16:47 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 23:16:47 2013 - [info]  read_only=1 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 23:16:47 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 23:16:47 2013 - [info] Checking replication filtering settings..
Sat Jan  5 23:16:47 2013 - [info]  binlog_do_db= , binlog_ignore_db=
Sat Jan  5 23:16:47 2013 - [info]  Replication filtering check ok.
Sat Jan  5 23:16:47 2013 - [info] Starting SSH connection tests..
cat: /var/log/masterha/app1/192.168.202.128_22_ssh_check.log: 
没有那个文件或目录
Sat Jan  5 23:16:47 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
cat: /var/log/masterha/app1/192.168.202.129_22_ssh_check.log: 
没有那个文件或目录
Sat Jan  5 23:16:48 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
cat: /var/log/masterha/app1/192.168.202.130_22_ssh_check.log: 
没有那个文件或目录
Sat Jan  5 23:16:48 2013 - [error][/usr/share/perl5/MHA/SSHCheck.pm, ln63]
Sat Jan  5 23:16:48 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln383] Error happend on checking configurations. SSH Configuration Check Failed!
 at /usr/share/perl5/MHA/MasterMonitor.pm line 339
Sat Jan  5 23:16:48 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln478] Error happened on monitoring servers.
Sat Jan  5 23:16:48 2013 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

Original comment by yanq...@b5m.com on 6 Jan 2013 at 2:59

GoogleCodeExporter commented 8 years ago
Does ops user have read/write access on /var/log/masterha/app1/ ? Please check 
$ touch /var/log/masterha/app1/aaa
$ rm /var/log/masterha/app1/aaa

Original comment by Yoshinor...@gmail.com on 6 Jan 2013 at 3:10

GoogleCodeExporter commented 8 years ago
Thank U,I love U

Yoshinor,It's OK now

I just run this command

sudo su - (I can sudo,but i don't know root passwd)

cd /var/log

chmod -R 777 masterha/

It's OK now!!!

Thanke you

Original comment by yanq...@b5m.com on 6 Jan 2013 at 3:19

GoogleCodeExporter commented 8 years ago
sorry,I see it again

may be it is not ok

i will to check it

thank u very much,Yoshinor

Original comment by yanq...@b5m.com on 6 Jan 2013 at 3:22

GoogleCodeExporter commented 8 years ago
Hi~~Yoshinor

This is new problem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ops@mha:/var/log/masterha/app1$ masterha_check_repl --conf=/etc/app1.cnf
Sat Jan  5 23:44:15 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Sat Jan  5 23:44:15 2013 - [info] Reading application default configurations 
from /etc/app1.cnf..
Sat Jan  5 23:44:15 2013 - [info] Reading server configurations from 
/etc/app1.cnf..
Sat Jan  5 23:44:15 2013 - [info] MHA::MasterMonitor version 0.53.
Sat Jan  5 23:44:15 2013 - [debug] Connecting to servers..
Sat Jan  5 23:44:15 2013 - [debug]  Connected to: 
192.168.202.128(192.168.202.128:3306), user=root
Sat Jan  5 23:44:15 2013 - [debug]  Connected to: 
192.168.202.129(192.168.202.129:3306), user=root
Sat Jan  5 23:44:15 2013 - [debug]  Connected to: 
192.168.202.130(192.168.202.130:3306), user=root
Sat Jan  5 23:44:15 2013 - [debug]  Comparing MySQL versions..
Sat Jan  5 23:44:15 2013 - [debug]   Comparing MySQL versions done.
Sat Jan  5 23:44:15 2013 - [debug] Connecting to servers done.
Sat Jan  5 23:44:15 2013 - [info] Dead Servers:
Sat Jan  5 23:44:15 2013 - [info] Alive Servers:
Sat Jan  5 23:44:15 2013 - [info]   192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:44:15 2013 - [info]   192.168.202.129(192.168.202.129:3306)
Sat Jan  5 23:44:15 2013 - [info]   192.168.202.130(192.168.202.130:3306)
Sat Jan  5 23:44:15 2013 - [info] Alive Slaves:
Sat Jan  5 23:44:15 2013 - [info]   192.168.202.129(192.168.202.129:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 23:44:15 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 23:44:15 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:44:15 2013 - [info]   192.168.202.130(192.168.202.130:3306)  
Version=5.1.66-0+squeeze1-log (oldest major version between slaves) 
log-bin:enabled
Sat Jan  5 23:44:15 2013 - [debug]    Relay log info repository: FILE
Sat Jan  5 23:44:15 2013 - [info]     Replicating from 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:44:15 2013 - [info] Current Alive Master: 
192.168.202.128(192.168.202.128:3306)
Sat Jan  5 23:44:15 2013 - [info] Checking slave configurations..
Sat Jan  5 23:44:15 2013 - [info]  read_only=1 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 23:44:15 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.129(192.168.202.129:3306).
Sat Jan  5 23:44:15 2013 - [info]  read_only=1 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 23:44:15 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.202.130(192.168.202.130:3306).
Sat Jan  5 23:44:15 2013 - [info] Checking replication filtering settings..
Sat Jan  5 23:44:15 2013 - [info]  binlog_do_db= , binlog_ignore_db=
Sat Jan  5 23:44:15 2013 - [info]  Replication filtering check ok.
Sat Jan  5 23:44:15 2013 - [info] Starting SSH connection tests..
Sat Jan  5 23:44:16 2013 - [debug]
Sat Jan  5 23:44:15 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to 
ops@192.168.202.129(192.168.202.129:22)..
Sat Jan  5 23:44:15 2013 - [debug]   ok.
Sat Jan  5 23:44:15 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.128(192.168.202.128:22) to 
ops@192.168.202.130(192.168.202.130:22)..
Sat Jan  5 23:44:15 2013 - [debug]   ok.
Sat Jan  5 23:44:16 2013 - [debug]
Sat Jan  5 23:44:16 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to 
ops@192.168.202.128(192.168.202.128:22)..
Sat Jan  5 23:44:16 2013 - [debug]   ok.
Sat Jan  5 23:44:16 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.129(192.168.202.129:22) to 
ops@192.168.202.130(192.168.202.130:22)..
Sat Jan  5 23:44:16 2013 - [debug]   ok.
Sat Jan  5 23:44:17 2013 - [debug]
Sat Jan  5 23:44:16 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to 
ops@192.168.202.128(192.168.202.128:22)..
Sat Jan  5 23:44:16 2013 - [debug]   ok.
Sat Jan  5 23:44:16 2013 - [debug]  Connecting via SSH from 
ops@192.168.202.130(192.168.202.130:22) to 
ops@192.168.202.129(192.168.202.129:22)..
Sat Jan  5 23:44:16 2013 - [debug]   ok.
Sat Jan  5 23:44:17 2013 - [info] All SSH connection tests passed successfully.
Sat Jan  5 23:44:17 2013 - [info] Checking MHA Node version..
Sat Jan  5 23:44:17 2013 - [info]  Version check ok.
Sat Jan  5 23:44:17 2013 - [info] Checking SSH publickey authentication 
settings on the current master..
Sat Jan  5 23:44:17 2013 - [info] HealthCheck: SSH to 192.168.202.128 is 
reachable.
Sat Jan  5 23:44:17 2013 - [info] Master MHA Node version is 0.53.
Sat Jan  5 23:44:17 2013 - [info] Checking recovery script configurations on 
the current master..
Sat Jan  5 23:44:17 2013 - [info]   Executing command: save_binary_logs 
--command=test --start_pos=4 --binlog_dir=/var/lib/mysql,/var/log/mysql 
--output_file=/var/log/masterha/app1/save_binary_logs_test 
--manager_version=0.53 --start_file=mysql-bin.000012 --debug
Sat Jan  5 23:44:17 2013 - [info]   Connecting to 
ops@192.168.202.128(192.168.202.128)..
  Creating /var/log/masterha/app1 if not exists..    ok.
  Checking output directory is accessible or not..
Failed to save binary log: 
权限不够:/var/log/masterha/app1/save_binary_logs_test
 at /usr/bin/save_binary_logs line 132
        eval {...} called at /usr/bin/save_binary_logs line 66
        main::main() called at /usr/bin/save_binary_logs line 62
Sat Jan  5 23:44:17 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln152] Master setting check failed!
Sat Jan  5 23:44:17 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln364] Master configuration failed.
Sat Jan  5 23:44:17 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln383] Error happend on checking configurations.  at 
/usr/bin/masterha_check_repl line 48
Sat Jan  5 23:44:17 2013 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, 
ln478] Error happened on monitoring servers.
Sat Jan  5 23:44:17 2013 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

Original comment by yanq...@b5m.com on 6 Jan 2013 at 3:28

GoogleCodeExporter commented 8 years ago
You don't have write permission to remote_workdir (/var/log/masterha/app1) on 
target MySQL servers. Please read log messages carefully and grant read/write 
access to workdir (on manager) and remote_workdir (on all MySQL servers).

Original comment by Yoshinor...@gmail.com on 6 Jan 2013 at 3:36

GoogleCodeExporter commented 8 years ago
Thank you!
Now it is OK

Because at the first time,I have not to create /var/log/masterha/app1 on all 
MySQL servers

Now I just run two steps

1、mkdir -p /var/log/masterha/app1

2、chmod -R 777 /var/log/masterha/app1

Thank you,Yoshinor,you are a good man

Very rigorous and patience

Thank U

Original comment by yanq...@b5m.com on 6 Jan 2013 at 4:21