ITPub博客

首页 > 数据库 > MySQL > MHA状况检查

MHA状况检查

原创 MySQL 作者:goolen 时间:2014-11-20 18:01:05 0 删除 编辑
环境:
Master:192.168.100.50
Slave1:192.168.100.48
Slave2:192.168.100.141 (MHA管理节点)

+++检查SSH的配置
[root@test11g masterha]# masterha_check_ssh --conf=/etc/masterha/mha.cnf  
Thu Nov 20 17:56:24 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Nov 20 17:56:24 2014 - [info] Reading application default configuration from /etc/masterha/mha.cnf..
Thu Nov 20 17:56:24 2014 - [info] Reading server configuration from /etc/masterha/mha.cnf..
Thu Nov 20 17:56:24 2014 - [info] Starting SSH connection tests..
Thu Nov 20 17:56:25 2014 - [debug] 
Thu Nov 20 17:56:24 2014 - [debug]  Connecting via SSH from root@192.168.100.50(192.168.100.50:22) to root@192.168.100.48(192.168.100.48:22)..
Thu Nov 20 17:56:25 2014 - [debug]   ok.
Thu Nov 20 17:56:25 2014 - [debug]  Connecting via SSH from root@192.168.100.50(192.168.100.50:22) to root@192.168.100.141(192.168.100.141:22)..
Thu Nov 20 17:56:25 2014 - [debug]   ok.
Thu Nov 20 17:56:26 2014 - [debug] 
Thu Nov 20 17:56:25 2014 - [debug]  Connecting via SSH from root@192.168.100.48(192.168.100.48:22) to root@192.168.100.50(192.168.100.50:22)..
Thu Nov 20 17:56:25 2014 - [debug]   ok.
Thu Nov 20 17:56:25 2014 - [debug]  Connecting via SSH from root@192.168.100.48(192.168.100.48:22) to root@192.168.100.141(192.168.100.141:22)..
Thu Nov 20 17:56:26 2014 - [debug]   ok.
Thu Nov 20 17:56:26 2014 - [debug] 
Thu Nov 20 17:56:25 2014 - [debug]  Connecting via SSH from root@192.168.100.141(192.168.100.141:22) to root@192.168.100.50(192.168.100.50:22)..
Thu Nov 20 17:56:26 2014 - [debug]   ok.
Thu Nov 20 17:56:26 2014 - [debug]  Connecting via SSH from root@192.168.100.141(192.168.100.141:22) to root@192.168.100.48(192.168.100.48:22)..
Thu Nov 20 17:56:26 2014 - [debug]   ok.
Thu Nov 20 17:56:26 2014 - [info] All SSH connection tests passed successfully.

+++检查整个复制环境状况
[root@test11g masterha]# masterha_check_repl --conf=/etc/masterha/mha.cnf 
Thu Nov 20 17:52:31 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Nov 20 17:52:31 2014 - [info] Reading application default configuration from /etc/masterha/mha.cnf..
Thu Nov 20 17:52:31 2014 - [info] Reading server configuration from /etc/masterha/mha.cnf..
Thu Nov 20 17:52:31 2014 - [info] MHA::MasterMonitor version 0.56.
Thu Nov 20 17:52:31 2014 - [info] GTID failover mode = 0
Thu Nov 20 17:52:31 2014 - [info] Dead Servers:
Thu Nov 20 17:52:31 2014 - [info] Alive Servers:
Thu Nov 20 17:52:31 2014 - [info]   192.168.100.50(192.168.100.50:3306)
Thu Nov 20 17:52:31 2014 - [info]   192.168.100.48(192.168.100.48:3306)
Thu Nov 20 17:52:31 2014 - [info]   192.168.100.141(192.168.100.141:3306)
Thu Nov 20 17:52:31 2014 - [info] Alive Slaves:
Thu Nov 20 17:52:31 2014 - [info]   192.168.100.48(192.168.100.48:3306)  Version=5.5.18-log (oldest major version between slaves) log-bin:enabled
Thu Nov 20 17:52:31 2014 - [info]     Replicating from 192.168.100.50(192.168.100.50:3306)
Thu Nov 20 17:52:31 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Thu Nov 20 17:52:31 2014 - [info]   192.168.100.141(192.168.100.141:3306)  Version=5.5.18-log (oldest major version between slaves) log-bin:enabled
Thu Nov 20 17:52:31 2014 - [info]     Replicating from 192.168.100.50(192.168.100.50:3306)
Thu Nov 20 17:52:31 2014 - [info] Current Alive Master: 192.168.100.50(192.168.100.50:3306)
Thu Nov 20 17:52:31 2014 - [info] Checking slave configurations..
Thu Nov 20 17:52:31 2014 - [info] Checking replication filtering settings..
Thu Nov 20 17:52:31 2014 - [info]  binlog_do_db= , binlog_ignore_db= 
Thu Nov 20 17:52:31 2014 - [info]  Replication filtering check ok.
Thu Nov 20 17:52:31 2014 - [info] GTID (with auto-pos) is not supported
Thu Nov 20 17:52:31 2014 - [info] Starting SSH connection tests..
Thu Nov 20 17:52:33 2014 - [info] All SSH connection tests passed successfully.
Thu Nov 20 17:52:33 2014 - [info] Checking MHA Node version..
Thu Nov 20 17:52:33 2014 - [info]  Version check ok.
Thu Nov 20 17:52:33 2014 - [info] Checking SSH publickey authentication settings on the current master..
Thu Nov 20 17:52:33 2014 - [info] HealthCheck: SSH to 192.168.100.50 is reachable.
Thu Nov 20 17:52:34 2014 - [info] Master MHA Node version is 0.56.
Thu Nov 20 17:52:34 2014 - [info] Checking recovery script configurations on 192.168.100.50(192.168.100.50:3306)..
Thu Nov 20 17:52:34 2014 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/tol/mysql/binlog --output_file=/tmp/save_binary_logs_test --manager_version=0.56 --start_file=mysql-bin.000004 
Thu Nov 20 17:52:34 2014 - [info]   Connecting to root@192.168.100.50(192.168.100.50:22).. 
  Creating /tmp if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /tol/mysql/binlog, up to mysql-bin.000004
Thu Nov 20 17:52:34 2014 - [info] Binlog setting check done.
Thu Nov 20 17:52:34 2014 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Thu Nov 20 17:52:34 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.100.48 --slave_ip=192.168.100.48 --slave_port=3306 --workdir=/tmp --target_version=5.5.18-log --manager_version=0.56 --relay_log_info=/tol/mysql/data/relay-log.info  --relay_dir=/tol/mysql/data/  --slave_pass=xxx
Thu Nov 20 17:52:34 2014 - [info]   Connecting to root@192.168.100.48(192.168.100.48:22).. 
  Checking slave recovery environment settings..
    Opening /tol/mysql/data/relay-log.info ... ok.
    Relay log found at /tol/mysql/data, up to coredb-relay-bin.000002
    Temporary relay log file is /tol/mysql/data/coredb-relay-bin.000002
    Testing mysql connection and privileges.. done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Nov 20 17:52:34 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='root' --slave_host=192.168.100.141 --slave_ip=192.168.100.141 --slave_port=3306 --workdir=/tmp --target_version=5.5.18-log --manager_version=0.56 --relay_log_info=/tol/mysql/data/relay-log.info  --relay_dir=/tol/mysql/data/  --slave_pass=xxx
Thu Nov 20 17:52:34 2014 - [info]   Connecting to root@192.168.100.141(192.168.100.141:22).. 
  Checking slave recovery environment settings..
    Opening /tol/mysql/data/relay-log.info ... ok.
    Relay log found at /tol/mysql/data, up to test11g-relay-bin.000002
    Temporary relay log file is /tol/mysql/data/test11g-relay-bin.000002
    Testing mysql connection and privileges.. done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Thu Nov 20 17:52:35 2014 - [info] Slaves settings check done.
Thu Nov 20 17:52:35 2014 - [info] 
192.168.100.50(192.168.100.50:3306) (current master)
 +--192.168.100.48(192.168.100.48:3306)
 +--192.168.100.141(192.168.100.141:3306)

Thu Nov 20 17:52:35 2014 - [info] Checking replication health on 192.168.100.48..
Thu Nov 20 17:52:35 2014 - [info]  ok.
Thu Nov 20 17:52:35 2014 - [info] Checking replication health on 192.168.100.141..
Thu Nov 20 17:52:35 2014 - [info]  ok.
Thu Nov 20 17:52:35 2014 - [info] Checking master_ip_failover_script status:
Thu Nov 20 17:52:35 2014 - [info]   /usr/bin/masterha_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.100.50 --orig_master_ip=192.168.100.50 --orig_master_port=3306 
Checking the Status of the script.. OK 
Thu Nov 20 17:52:35 2014 - [info]  OK.
Thu Nov 20 17:52:35 2014 - [warning] shutdown_script is not defined.
Thu Nov 20 17:52:35 2014 - [info] Got exit code 0 (Not master dead).

MySQL Replication Health is OK.

+++检查MHA manager的状态:
[root@test11g masterha]# masterha_check_status --conf=/etc/masterha/mha.cnf 
mha (pid:29503) is running(0:PING_OK), master:192.168.100.50

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23249684/viewspace-1340734/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: MHA在线切换
下一篇: MHA启动过程
请登录后发表评论 登录
全部评论

注册时间:2011-10-20

  • 博文量
    121
  • 访问量
    731655