InstallMysqlMHAOnRedhat6.3(六)

2015-07-24 09:07:26 · 作者: · 浏览: 6
_relay_logs --command=test --slave_user='root' --slave_host=192.168.56.162 --slave_ip=192.168.56.162 --slave_port=3306 --workdir=/var/tmp --target_version=5.5.35-log --manager_version=0.56 --relay_log_info=/var/lib/mysql/relay-log.info --relay_dir=/var/lib/mysql/ --slave_pass=xxx Wed Feb 11 02:12:04 2015 - [info] Connecting to root@192.168.56.162(192.168.56.162:22).. Checking slave recovery environment settings.. Opening /var/lib/mysql/relay-log.info ... ok. Relay log found at /var/lib/mysql, up to zbdba3-relay-bin.000007 Temporary relay log file is /var/lib/mysql/zbdba3-relay-bin.000007 Testing mysql connection and privileges.. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Wed Feb 11 02:12:04 2015 - [info] Slaves settings check done. Wed Feb 11 02:12:04 2015 - [info] 192.168.56.161(192.168.56.161:3306) (current master) +--192.168.56.162(192.168.56.162:3306) Wed Feb 11 02:12:04 2015 - [warning] master_ip_failover_script is not defined. Wed Feb 11 02:12:04 2015 - [warning] shutdown_script is not defined. Wed Feb 11 02:12:04 2015 - [info] Set master ping interval 1 seconds. Wed Feb 11 02:12:04 2015 - [warning] secondary_check_script is not defined. It is highly recommended setting it to check master reachability from two or more routes. Wed Feb 11 02:12:04 2015 - [info] Starting ping health check on 192.168.56.161(192.168.56.161:3306).. Wed Feb 11 02:12:04 2015 - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond.. 查看manager状态: [root@zbdba1 masterha]# masterha_check_status --conf=/etc/masterha/app1.cnf app1 (pid:7632) is running(0:PING_OK), master:192.168.56.161
7、测试MHA

?

关闭node1:
[root@zbdba2 database]# service mysql stop
Shutting down MySQL... SUCCESS!

跟踪manager日志:

?

Wed Feb 11 02:16:49 2015 - [warning] Got error on MySQL select ping: 2006 (MySQL server has gone away)
Wed Feb 11 02:16:49 2015 - [info] Executing SSH check script: save_binary_logs --command=test --start_pos=4 --binlog_dir=/var/lib/mysql --output_file=/var/tmp/save_binary_logs_test --manager_version=0.56 --binlog_prefix=mysql-bin
Wed Feb 11 02:16:49 2015 - [info] HealthCheck: SSH to 192.168.56.161 is reachable.
Wed Feb 11 02:16:50 2015 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Wed Feb 11 02:16:50 2015 - [warning] Connection failed 2 time(s)..
Wed Feb 11 02:16:51 2015 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Wed Feb 11 02:16:51 2015 - [warning] Connection failed 3 time(s)..
Wed Feb 11 02:16:52 2015 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Wed Feb 11 02:16:52 2015 - [warning] Connection failed 4 time(s)..
Wed Feb 11 02:16:52 2015 - [warning] Master is not reachable from health checker!
Wed Feb 11 02:16:52 2015 - [warning] Master 192.168.56.161(192.168.56.161:3306) is not reachable!
Wed Feb 11 02:16:52 2015 - [warning] SSH is reachable.
Wed Feb 11 02:16:52 2015 - [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/masterha/app1.cnf again, and trying to connect to all servers to check server status..
Wed Feb 11 02:16:52 2015 - [warning