MHA performs automating master failover and slave promotion with minimal downtime, usually within 10-30 seconds. MHA prevents replication consistency problems and saves on expenses of having to acquire additional servers. All this with zero performance degradation, no complexity (easy-to-install) and requiring no change to existing deployments.
[root@masterham mhatest]# masterha_check_ssh --conf=/root/mhatest/app1.cnf Wed Mar 4 09:12:48 2015 - [info] Reading default configuration from /etc/masterha_default.cnf.. Wed Mar 4 09:12:48 2015 - [info] Reading application default configuration from /root/mhatest/app1.cnf.. Wed Mar 4 09:12:48 2015 - [info] Reading server configuration from /root/mhatest/app1.cnf.. Wed Mar 4 09:12:48 2015 - [info] Starting SSH connection tests.. Wed Mar 4 09:12:49 2015 - [debug] Wed Mar 4 09:12:48 2015 - [debug] Connecting via SSH from root@192.168.19.134(192.168.19.134:22) to root@192.168.19.135(192.168.19.135:22).. Wed Mar 4 09:12:48 2015 - [debug] ok. Wed Mar 4 09:12:48 2015 - [debug] Connecting via SSH from root@192.168.19.134(192.168.19.134:22) to root@192.168.19.136(192.168.19.136:22).. Wed Mar 4 09:12:49 2015 - [debug] ok. Wed Mar 4 09:12:49 2015 - [debug] Wed Mar 4 09:12:48 2015 - [debug] Connecting via SSH from root@192.168.19.135(192.168.19.135:22) to root@192.168.19.134(192.168.19.134:22).. Wed Mar 4 09:12:49 2015 - [debug] ok. Wed Mar 4 09:12:49 2015 - [debug] Connecting via SSH from root@192.168.19.135(192.168.19.135:22) to root@192.168.19.136(192.168.19.136:22).. Wed Mar 4 09:12:49 2015 - [debug] ok. Wed Mar 4 09:12:50 2015 - [debug] Wed Mar 4 09:12:49 2015 - [debug] Connecting via SSH from root@192.168.19.136(192.168.19.136:22) to root@192.168.19.134(192.168.19.134:22).. Wed Mar 4 09:12:49 2015 - [debug] ok. Wed Mar 4 09:12:49 2015 - [debug] Connecting via SSH from root@192.168.19.136(192.168.19.136:22) to root@192.168.19.135(192.168.19.135:22).. Wed Mar 4 09:12:50 2015 - [debug] ok. Wed Mar 4 09:12:50 2015 - [info] All SSH connection tests passed successfully.
[root@masterham mhatest]# masterha_check_repl --conf=/root/mhatest/app1.cnf Wed Mar 4 09:13:49 2015 - [info] Reading default configuration from /etc/masterha_default.cnf.. Wed Mar 4 09:13:49 2015 - [info] Reading application default configuration from /root/mhatest/app1.cnf.. Wed Mar 4 09:13:49 2015 - [info] Reading server configuration from /root/mhatest/app1.cnf.. Wed Mar 4 09:13:49 2015 - [info] MHA::MasterMonitor version 0.56. Wed Mar 4 09:13:50 2015 - [info] GTID failover mode = 0 Wed Mar 4 09:13:50 2015 - [info] Dead Servers: Wed Mar 4 09:13:50 2015 - [info] Alive Servers: Wed Mar 4 09:13:50 2015 - [info] 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:13:50 2015 - [info] 192.168.19.135(192.168.19.135:3306) Wed Mar 4 09:13:50 2015 - [info] 192.168.19.136(192.168.19.136:3306) Wed Mar 4 09:13:50 2015 - [info] Alive Slaves: Wed Mar 4 09:13:50 2015 - [info] 192.168.19.135(192.168.19.135:3306) Version=5.6.19-67.0-log (oldest major version between slaves) log-bin:enabled Wed Mar 4 09:13:50 2015 - [info] Replicating from 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:13:50 2015 - [info] 192.168.19.136(192.168.19.136:3306) Version=5.6.19-67.0-log (oldest major version between slaves) log-bin:enabled Wed Mar 4 09:13:50 2015 - [info] Replicating from 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:13:50 2015 - [info] Current Alive Master: 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:13:50 2015 - [info] Checking slave configurations.. Wed Mar 4 09:13:50 2015 - [info] Checking replication filtering settings.. Wed Mar 4 09:13:50 2015 - [info] binlog_do_db= , binlog_ignore_db= Wed Mar 4 09:13:50 2015 - [info] Replication filtering check ok. Wed Mar 4 09:13:50 2015 - [info] GTID (with auto-pos) is not supported Wed Mar 4 09:13:50 2015 - [info] Starting SSH connection tests.. Wed Mar 4 09:13:51 2015 - [info] All SSH connection tests passed successfully. Wed Mar 4 09:13:51 2015 - [info] Checking MHA Node version.. Wed Mar 4 09:13:52 2015 - [info] Version check ok. Wed Mar 4 09:13:52 2015 - [info] Checking SSH publickey authentication settings on the current master.. Wed Mar 4 09:13:52 2015 - [info] HealthCheck: SSH to 192.168.19.134 is reachable. Wed Mar 4 09:13:52 2015 - [info] Master MHA Node version is 0.56. Wed Mar 4 09:13:52 2015 - [info] Checking recovery script configurations on 192.168.19.134(192.168.19.134:3306).. Wed Mar 4 09:13:52 2015 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/log/mysql3306/binlog --output_file=/var/tmp/save_binary_logs_test --manager_version=0.56 --start_file=binlog.000005 Wed Mar 4 09:13:52 2015 - [info] Connecting to root@192.168.19.134(192.168.19.134:22).. Creating /var/tmp if not exists.. ok. Checking output directory is accessible or not.. ok. Binlog found at /log/mysql3306/binlog, up to binlog.000005 Wed Mar 4 09:13:52 2015 - [info] Binlog setting check done. Wed Mar 4 09:13:52 2015 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers.. Wed Mar 4 09:13:52 2015 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_test' --slave_host=192.168.19.135 --slave_ip=192.168.19.135 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.19-67.0-log --manager_version=0.56 --relay_dir=/log/mysql3306/binlog --current_relay_log=relaylog.3794333 --slave_pass=xxx Wed Mar 4 09:13:52 2015 - [info] Connecting to root@192.168.19.135(192.168.19.135:22).. Checking slave recovery environment settings.. Relay log found at /log/mysql3306/binlog, up to relaylog.3794334 Temporary relay log file is /log/mysql3306/binlog/relaylog.3794334 Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Wed Mar 4 09:13:52 2015 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_test' --slave_host=192.168.19.136 --slave_ip=192.168.19.136 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.19-67.0-log --manager_version=0.56 --relay_dir=/log/mysql3306/binlog --current_relay_log=relaylog.3794333 --slave_pass=xxx Wed Mar 4 09:13:52 2015 - [info] Connecting to root@192.168.19.136(192.168.19.136:22).. Checking slave recovery environment settings.. Relay log found at /log/mysql3306/binlog, up to relaylog.3794334 Temporary relay log file is /log/mysql3306/binlog/relaylog.3794334 Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Wed Mar 4 09:13:52 2015 - [info] Slaves settings check done. Wed Mar 4 09:13:52 2015 - [info] 192.168.19.134(192.168.19.134:3306) (current master) +--192.168.19.135(192.168.19.135:3306) +--192.168.19.136(192.168.19.136:3306) Wed Mar 4 09:13:52 2015 - [info] Checking replication health on 192.168.19.135.. Wed Mar 4 09:13:52 2015 - [info] ok. Wed Mar 4 09:13:52 2015 - [info] Checking replication health on 192.168.19.136.. Wed Mar 4 09:13:52 2015 - [info] ok. Wed Mar 4 09:13:52 2015 - [warning] master_ip_failover_script is not defined. Wed Mar 4 09:13:52 2015 - [warning] shutdown_script is not defined. Wed Mar 4 09:13:52 2015 - [info] Got exit code 0 (Not master dead). MySQL Replication Health is OK.
Wed Mar 4 09:15:00 2015 - [info] MHA::MasterMonitor version 0.56. Wed Mar 4 09:15:01 2015 - [info] GTID failover mode = 0 Wed Mar 4 09:15:01 2015 - [info] Dead Servers: Wed Mar 4 09:15:01 2015 - [info] Alive Servers: Wed Mar 4 09:15:01 2015 - [info] 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:15:01 2015 - [info] 192.168.19.135(192.168.19.135:3306) Wed Mar 4 09:15:01 2015 - [info] 192.168.19.136(192.168.19.136:3306) Wed Mar 4 09:15:01 2015 - [info] Alive Slaves: Wed Mar 4 09:15:01 2015 - [info] 192.168.19.135(192.168.19.135:3306) Version=5.6.19-67.0-log (oldest major version between slaves) log-bin:enabled Wed Mar 4 09:15:01 2015 - [info] Replicating from 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:15:01 2015 - [info] 192.168.19.136(192.168.19.136:3306) Version=5.6.19-67.0-log (oldest major version between slaves) log-bin:enabled Wed Mar 4 09:15:01 2015 - [info] Replicating from 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:15:01 2015 - [info] Current Alive Master: 192.168.19.134(192.168.19.134:3306) Wed Mar 4 09:15:01 2015 - [info] Checking slave configurations.. Wed Mar 4 09:15:01 2015 - [info] Checking replication filtering settings.. Wed Mar 4 09:15:01 2015 - [info] binlog_do_db= , binlog_ignore_db= Wed Mar 4 09:15:01 2015 - [info] Replication filtering check ok. Wed Mar 4 09:15:01 2015 - [info] GTID (with auto-pos) is not supported Wed Mar 4 09:15:01 2015 - [info] Starting SSH connection tests.. Wed Mar 4 09:15:02 2015 - [info] All SSH connection tests passed successfully. Wed Mar 4 09:15:02 2015 - [info] Checking MHA Node version.. Wed Mar 4 09:15:03 2015 - [info] Version check ok. Wed Mar 4 09:15:03 2015 - [info] Checking SSH publickey authentication settings on the current master.. Wed Mar 4 09:15:03 2015 - [info] HealthCheck: SSH to 192.168.19.134 is reachable. Wed Mar 4 09:15:03 2015 - [info] Master MHA Node version is 0.56. Wed Mar 4 09:15:03 2015 - [info] Checking recovery script configurations on 192.168.19.134(192.168.19.134:3306).. Wed Mar 4 09:15:03 2015 - [info] Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/log/mysql3306/binlog --output_file=/var/tmp/save_binary_logs_test --manager_version=0.56 --start_file=binlog.000005 Wed Mar 4 09:15:03 2015 - [info] Connecting to root@192.168.19.134(192.168.19.134:22).. Creating /var/tmp if not exists.. ok. Checking output directory is accessible or not.. ok. Binlog found at /log/mysql3306/binlog, up to binlog.000005 Wed Mar 4 09:15:03 2015 - [info] Binlog setting check done. Wed Mar 4 09:15:03 2015 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers.. Wed Mar 4 09:15:03 2015 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_test' --slave_host=192.168.19.135 --slave_ip=192.168.19.135 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.19-67.0-log --manager_version=0.56 --relay_dir=/log/mysql3306/binlog --current_relay_log=relaylog.3794333 --slave_pass=xxx Wed Mar 4 09:15:03 2015 - [info] Connecting to root@192.168.19.135(192.168.19.135:22).. Checking slave recovery environment settings.. Relay log found at /log/mysql3306/binlog, up to relaylog.3794334 Temporary relay log file is /log/mysql3306/binlog/relaylog.3794334 Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Wed Mar 4 09:15:03 2015 - [info] Executing command : apply_diff_relay_logs --command=test --slave_user='mha_test' --slave_host=192.168.19.136 --slave_ip=192.168.19.136 --slave_port=3306 --workdir=/var/tmp --target_version=5.6.19-67.0-log --manager_version=0.56 --relay_dir=/log/mysql3306/binlog --current_relay_log=relaylog.3794333 --slave_pass=xxx Wed Mar 4 09:15:03 2015 - [info] Connecting to root@192.168.19.136(192.168.19.136:22).. Checking slave recovery environment settings.. Relay log found at /log/mysql3306/binlog, up to relaylog.3794334 Temporary relay log file is /log/mysql3306/binlog/relaylog.3794334 Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure. done. Testing mysqlbinlog output.. done. Cleaning up test file(s).. done. Wed Mar 4 09:15:04 2015 - [info] Slaves settings check done. Wed Mar 4 09:15:04 2015 - [info] 192.168.19.134(192.168.19.134:3306) (current master) +--192.168.19.135(192.168.19.135:3306) +--192.168.19.136(192.168.19.136:3306) Wed Mar 4 09:15:04 2015 - [warning] master_ip_failover_script is not defined. Wed Mar 4 09:15:04 2015 - [warning] shutdown_script is not defined. Wed Mar 4 09:15:04 2015 - [info] Set master ping interval 2 seconds. Wed Mar 4 09:15: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 Mar 4 09:15:04 2015 - [info] Starting ping health check on 192.168.19.134(192.168.19.134:3306).. Wed Mar 4 09:15:04 2015 - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond..