yoshinorim / mha4mysql-manager

Development tree of Master High Availability Manager and tools for MySQL (MHA), Manager part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
1.46k stars 501 forks source link

[info] Executing SSH check script: exit 0 hanging #154

Open zishiguo opened 2 years ago

zishiguo commented 2 years ago

start manager command as follows

masterha_manager --conf=/etc/app1.cnf > /var/log/mha/mha.log 2>&1 &

tail -f /var/log/masterha/app1/app1.log

Mon Aug 15 11:21:10 2022 - [info] MHA::MasterMonitor version 0.58.
Mon Aug 15 11:21:12 2022 - [info] GTID failover mode = 1
Mon Aug 15 11:21:12 2022 - [info] Dead Servers:
Mon Aug 15 11:21:12 2022 - [info] Alive Servers:
Mon Aug 15 11:21:12 2022 - [info]   172.22.12.69(172.22.12.69:3306)
Mon Aug 15 11:21:12 2022 - [info]   172.22.12.70(172.22.12.70:3306)
Mon Aug 15 11:21:12 2022 - [info] Alive Slaves:
Mon Aug 15 11:21:12 2022 - [info]   172.22.12.70(172.22.12.70:3306)  Version=5.7.39-log (oldest major version between slaves) log-bin:enabled
Mon Aug 15 11:21:12 2022 - [info]     GTID ON
Mon Aug 15 11:21:12 2022 - [info]     Replicating from 172.22.12.69(172.22.12.69:3306)
Mon Aug 15 11:21:12 2022 - [info] Current Alive Master: 172.22.12.69(172.22.12.69:3306)
Mon Aug 15 11:21:12 2022 - [info] Checking slave configurations..
Mon Aug 15 11:21:12 2022 - [info] Checking replication filtering settings..
Mon Aug 15 11:21:12 2022 - [info]  binlog_do_db= , binlog_ignore_db=
Mon Aug 15 11:21:12 2022 - [info]  Replication filtering check ok.
Mon Aug 15 11:21:12 2022 - [info] GTID (with auto-pos) is supported. Skipping all SSH and Node package checking.
Mon Aug 15 11:21:12 2022 - [info] Checking SSH publickey authentication settings on the current master..
Mon Aug 15 11:21:12 2022 - [info] HealthCheck: SSH to 172.22.12.69 is reachable.
Mon Aug 15 11:21:12 2022 - [info]
172.22.12.69(172.22.12.69:3306) (current master)
 +--172.22.12.70(172.22.12.70:3306)

Mon Aug 15 11:21:12 2022 - [warning] master_ip_failover_script is not defined.
Mon Aug 15 11:21:12 2022 - [warning] shutdown_script is not defined.
Mon Aug 15 11:21:12 2022 - [info] Set master ping interval 3 seconds.
Mon Aug 15 11:21:12 2022 - [warning] secondary_check_script is not defined. It is highly recommended setting it to check master reachability from two or more routes.
Mon Aug 15 11:21:12 2022 - [info] Starting ping health check on 172.22.12.69(172.22.12.69:3306)..
Mon Aug 15 11:21:12 2022 - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond..
Mon Aug 15 11:26:06 2022 - [warning] Got error on MySQL select ping: 2006 (MySQL server has gone away)
Mon Aug 15 11:26:06 2022 - [info] Executing SSH check script: exit 0

/etc/app1.cnf as follows

[server default]
# mysql user and password
user=root
password=123456
# 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
# report_script=/etc/mha_master/scripts/mha-slb/mha-slb

[server1]
hostname=172.22.12.69

[server2]
hostname=172.22.12.70

masterha_check_ssh --conf=/etc/app1.cnf

[root@iZgc751f421znb56v0h6wiZ ~]# masterha_check_ssh  --conf=/etc/app1.cnf
Mon Aug 15 13:34:13 2022 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Mon Aug 15 13:34:13 2022 - [info] Reading application default configuration from /etc/app1.cnf..
Mon Aug 15 13:34:13 2022 - [info] Reading server configuration from /etc/app1.cnf..
Mon Aug 15 13:34:13 2022 - [info] Starting SSH connection tests..
Mon Aug 15 13:34:13 2022 - [debug]
Mon Aug 15 13:34:13 2022 - [debug]  Connecting via SSH from root@172.22.12.69(172.22.12.69:22) to root@172.22.12.70(172.22.12.70:22)..
Mon Aug 15 13:34:13 2022 - [debug]   ok.
Mon Aug 15 13:34:14 2022 - [debug]
Mon Aug 15 13:34:13 2022 - [debug]  Connecting via SSH from root@172.22.12.70(172.22.12.70:22) to root@172.22.12.69(172.22.12.69:22)..
Mon Aug 15 13:34:13 2022 - [debug]   ok.
Mon Aug 15 13:34:14 2022 - [info] All SSH connection tests passed successfully.
zishiguo commented 2 years ago

solved. use

nohup masterha_manager --conf=/etc/app1.cnf > /var/log/mha/mha.log 2>&1 &

instead of

masterha_manager --conf=/etc/app1.cnf > /var/log/mha/mha.log 2>&1 &