matthewbogner / mysql-master-ha

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

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

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
1: 4 server 
192.168.1.200(master),192.168.1.153(slave),192.168.1.197(slave),192.168.1.197 
(Node manager)

2: this is the configure file
[root@CENTOS4 ~]# cat /etc/masterha/app1.cnf
[server default]
master_binlog_dir=/usr/local/mysql/data
manager_workdir=/etc/masterha/
manager_log=/etc/masterha/manager.log
remote_workdir=/var/log/masterha/app1
user=keepalived
password=123123
ssh_user=dbaroot
repl_user=keepalived
repl_password=123123
ping_interval=1
shutdown_script=""
master_ip_online_change_script=""
report_script=""
log_level=debug

[server1]
hostname=192.168.1.200
master_binlog_dir=/usr/local/mysql/data
candidate_master=1

[server2]
hostname=192.168.1.153
#master_binlog_dir=/usr/local/mysql/data
candidate_master=1

[server3]
hostname=192.168.1.197
#master_binlog_dir=/usr/local/mysql/data
no_master=1

3.masterha_check_repl --conf=/etc/masterha/app1.cnf get error 
Testing mysql connection and privileges..sh: mysql: command not found

I paste the full log message here
[root@CENTOS4 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Wed Nov 20 18:23:24 2013 - [warning] Global configuration file 
/etc/masterha_default.cnf not found. Skipping.
Wed Nov 20 18:23:24 2013 - [info] Reading application default configurations 
from /etc/masterha/app1.cnf..
Wed Nov 20 18:23:24 2013 - [info] Reading server configurations from 
/etc/masterha/app1.cnf..
Wed Nov 20 18:23:24 2013 - [info] MHA::MasterMonitor version 0.55.
Wed Nov 20 18:23:24 2013 - [debug] Connecting to servers..
Wed Nov 20 18:23:24 2013 - [debug]  Connected to: 
192.168.1.200(192.168.1.200:3306), user=keepalived
Wed Nov 20 18:23:24 2013 - [debug]  Connected to: 
192.168.1.153(192.168.1.153:3306), user=keepalived
Wed Nov 20 18:23:24 2013 - [debug]  Connected to: 
192.168.1.197(192.168.1.197:3306), user=keepalived
Wed Nov 20 18:23:24 2013 - [warning] SQL Thread is stopped(no error) on 
192.168.1.197(192.168.1.197:3306)
Wed Nov 20 18:23:24 2013 - [debug]  Comparing MySQL versions..
Wed Nov 20 18:23:24 2013 - [debug]   Comparing MySQL versions done.
Wed Nov 20 18:23:24 2013 - [debug] Connecting to servers done.
Wed Nov 20 18:23:24 2013 - [info] Dead Servers:
Wed Nov 20 18:23:24 2013 - [info] Alive Servers:
Wed Nov 20 18:23:24 2013 - [info]   192.168.1.200(192.168.1.200:3306)
Wed Nov 20 18:23:24 2013 - [info]   192.168.1.153(192.168.1.153:3306)
Wed Nov 20 18:23:24 2013 - [info]   192.168.1.197(192.168.1.197:3306)
Wed Nov 20 18:23:24 2013 - [info] Alive Slaves:
Wed Nov 20 18:23:24 2013 - [info]   192.168.1.153(192.168.1.153:3306)  
Version=5.6.11-log (oldest major version between slaves) log-bin:enabled
Wed Nov 20 18:23:24 2013 - [debug]    Relay log info repository: TABLE
Wed Nov 20 18:23:24 2013 - [info]     Replicating from 
192.168.1.200(192.168.1.200:3306)
Wed Nov 20 18:23:24 2013 - [info]     Primary candidate for the new Master 
(candidate_master is set)
Wed Nov 20 18:23:24 2013 - [info]   192.168.1.197(192.168.1.197:3306)  
Version=5.6.11-log (oldest major version between slaves) log-bin:enabled
Wed Nov 20 18:23:24 2013 - [debug]    Relay log info repository: TABLE
Wed Nov 20 18:23:24 2013 - [info]     Replicating from 
192.168.1.200(192.168.1.200:3306)
Wed Nov 20 18:23:24 2013 - [info]     Not candidate for the new Master 
(no_master is set)
Wed Nov 20 18:23:24 2013 - [info] Current Alive Master: 
192.168.1.200(192.168.1.200:3306)
Wed Nov 20 18:23:24 2013 - [info] Checking slave configurations..
Wed Nov 20 18:23:24 2013 - [info]  read_only=1 is not set on slave 
192.168.1.153(192.168.1.153:3306).
Wed Nov 20 18:23:24 2013 - [warning]  relay_log_purge=0 is not set on slave 
192.168.1.153(192.168.1.153:3306).
Wed Nov 20 18:23:24 2013 - [info]  read_only=1 is not set on slave 
192.168.1.197(192.168.1.197:3306).
Wed Nov 20 18:23:24 2013 - [info] Checking replication filtering settings..
Wed Nov 20 18:23:24 2013 - [info]  binlog_do_db= , binlog_ignore_db= mysql,test
Wed Nov 20 18:23:24 2013 - [info]  Replication filtering check ok.
Wed Nov 20 18:23:24 2013 - [info] Starting SSH connection tests..
Wed Nov 20 18:23:26 2013 - [debug]
Wed Nov 20 18:23:24 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.200(192.168.1.200:22) to 
dbaroot@192.168.1.153(192.168.1.153:22)..
Wed Nov 20 18:23:25 2013 - [debug]   ok.
Wed Nov 20 18:23:25 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.200(192.168.1.200:22) to 
dbaroot@192.168.1.197(192.168.1.197:22)..
Wed Nov 20 18:23:26 2013 - [debug]   ok.
Wed Nov 20 18:23:27 2013 - [debug]
Wed Nov 20 18:23:24 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.153(192.168.1.153:22) to 
dbaroot@192.168.1.200(192.168.1.200:22)..
Wed Nov 20 18:23:26 2013 - [debug]   ok.
Wed Nov 20 18:23:26 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.153(192.168.1.153:22) to 
dbaroot@192.168.1.197(192.168.1.197:22)..
Wed Nov 20 18:23:27 2013 - [debug]   ok.
Wed Nov 20 18:23:27 2013 - [debug]
Wed Nov 20 18:23:25 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.197(192.168.1.197:22) to 
dbaroot@192.168.1.200(192.168.1.200:22)..
Wed Nov 20 18:23:26 2013 - [debug]   ok.
Wed Nov 20 18:23:26 2013 - [debug]  Connecting via SSH from 
dbaroot@192.168.1.197(192.168.1.197:22) to 
dbaroot@192.168.1.153(192.168.1.153:22)..
Wed Nov 20 18:23:27 2013 - [debug]   ok.
Wed Nov 20 18:23:27 2013 - [info] All SSH connection tests passed successfully.
Wed Nov 20 18:23:27 2013 - [info] Checking MHA Node version..
Wed Nov 20 18:23:28 2013 - [info]  Version check ok.
Wed Nov 20 18:23:28 2013 - [info] Checking SSH publickey authentication 
settings on the current master..
Wed Nov 20 18:23:28 2013 - [debug] SSH connection test to 192.168.1.200, option 
-o StrictHostKeyChecking=no -o PasswordAuthentication=no -o BatchMode=yes -o 
ConnectTimeout=5, timeout 5
Wed Nov 20 18:23:29 2013 - [info] HealthCheck: SSH to 192.168.1.200 is 
reachable.
Wed Nov 20 18:23:29 2013 - [info] Master MHA Node version is 0.54.
Wed Nov 20 18:23:29 2013 - [info] Checking recovery script configurations on 
the current master..
Wed Nov 20 18:23:29 2013 - [info]   Executing command: save_binary_logs 
--command=test --start_pos=4 --binlog_dir=/usr/local/mysql/data 
--output_file=/var/log/masterha/app1/save_binary_logs_test 
--manager_version=0.55 --start_file=log-bin.000032 --debug
Wed Nov 20 18:23:29 2013 - [info]   Connecting to 
dbaroot@192.168.1.200(192.168.1.200)..
  Creating /var/log/masterha/app1 if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /usr/local/mysql/data, up to log-bin.000032
Wed Nov 20 18:23:30 2013 - [info] Master setting check done.
Wed Nov 20 18:23:30 2013 - [info] Checking SSH publickey authentication and 
checking recovery script configurations on all alive slave servers..
Wed Nov 20 18:23:30 2013 - [info]   Executing command : apply_diff_relay_logs 
--command=test --slave_user='keepalived' --slave_host=192.168.1.153 
--slave_ip=192.168.1.153 --slave_port=3306 --workdir=/var/log/masterha/app1 
--target_version=5.6.11-log --manager_version=0.55 
--relay_dir=/usr/local/mysql/data --current_relay_log=CENTOS3-relay-bin.000058  
--debug  --slave_pass=xxx
Wed Nov 20 18:23:30 2013 - [info]   Connecting to 
dbaroot@192.168.1.153(192.168.1.153:22)..
  Checking slave recovery environment settings..
    Relay log found at /usr/local/mysql/data, up to CENTOS3-relay-bin.000059
    Temporary relay log file is /usr/local/mysql/data/CENTOS3-relay-bin.000059
    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 367.
        main::check() called at /usr/local/bin/apply_diff_relay_logs line 486
        eval {...} called at /usr/local/bin/apply_diff_relay_logs line 466
        main::main() called at /usr/local/bin/apply_diff_relay_logs line 112
Wed Nov 20 18:23:30 2013 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, 
ln195] Slaves settings check failed!
Wed Nov 20 18:23:30 2013 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, 
ln375] Slave configuration failed.
Wed Nov 20 18:23:30 2013 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, 
ln386] Error happend on checking configurations.  at 
/usr/local/bin/masterha_check_repl line 48.
Wed Nov 20 18:23:30 2013 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, 
ln482] Error happened on monitoring servers.
Wed Nov 20 18:23:30 2013 - [info] Got exit code 1 (Not master dead).

MySQL Replication Health is NOT OK!

4: MySQL connection between those 3 MySQL servers running well, replication 
running well, also run 
echo 'export PATH=$PATH:/usr/local/mysql/bin'>>/etc/profile
source /etc/profile 
for those 3 MySQL servers

please help me, thanks

Best Regards
Garey

Original issue reported on code.google.com by gb.oldga...@gmail.com on 20 Nov 2013 at 10:47

GoogleCodeExporter commented 8 years ago
Sorry
1: 4 server 
192.168.1.200(master),192.168.1.153(slave),192.168.1.197(slave),192.168.1.193 
(Node manager)

the node manager is 192.168.1.193,  it's not 192.168.1.197 , Sorry again.

Original comment by gb.oldga...@gmail.com on 20 Nov 2013 at 10:49

GoogleCodeExporter commented 8 years ago
mysql command path could not be resolved on 192.168.1.153. Please check by
"ssh 192.168.1.153 mysql --version" and test installing mysql binary under 
proper directory (i.e. under /usr/bin/).

Original comment by Yoshinor...@gmail.com on 20 Nov 2013 at 10:51

GoogleCodeExporter commented 8 years ago
thanks Yoshinor, problem settled, thanks again.

Original comment by gb.oldga...@gmail.com on 21 Nov 2013 at 5:20

GoogleCodeExporter commented 8 years ago
[root@CentOS-112 bin]# ln -s /usr/local/mysql/bin/mysql mysql
[root@CentOS-112 bin]# pwd
/usr/bin

Original comment by weifeilo...@gmail.com on 2 Mar 2014 at 10:04