MySQL MHA相关测试

本文详细介绍了MySQLMHA的安装与配置过程,并通过SSH信任关系检测与MHA相关测试,验证了集群的正常运行状态。包括MHA::MasterMonitor版本确认、GTID失败回滚模式、存活服务器列表、从属服务器配置、复制过滤设置、GTID支持情况、SSH连接测试、节点版本检查等关键环节。

接上篇文章,介绍了如何安装mysql mha,地址如下:http://blog.youkuaiyun.com/yiyuf/article/details/40340895

下面接着进行mha的相关测试:

SSH 信任关系检测:

[root@mha scripts]# masterha_check_ssh --conf=/etc/app1.cnf 

Fri Oct 17 09:45:45 2014 - [info] Reading default configuration from /etc/masterha_default.cnf..

Fri Oct 17 09:45:45 2014 - [info] Reading application default configuration from /etc/app1.cnf..

Fri Oct 17 09:45:45 2014 - [info] Reading server configuration from /etc/app1.cnf..

Fri Oct 17 09:45:45 2014 - [info] Starting SSH connection tests..

Fri Oct 17 09:45:46 2014 - [debug] 

Fri Oct 17 09:45:45 2014 - [debug]  Connecting via SSH from root@192.168.56.110(192.168.56.110:22) to root@192.168.56.113(192.168.56.113:22)..

Fri Oct 17 09:45:46 2014 - [debug]   ok.

Fri Oct 17 09:45:47 2014 - [debug] 

Fri Oct 17 09:45:46 2014 - [debug]  Connecting via SSH from root@192.168.56.113(192.168.56.113:22) to root@192.168.56.110(192.168.56.110:22)..

Fri Oct 17 09:45:47 2014 - [debug]   ok.

Fri Oct 17 09:45:47 2014 - [info] All SSH connection tests passed successfully

[root@mha ~]# masterha_check_repl --conf=/etc/app1.cnf 
Tue Oct 21 11:06:59 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Oct 21 11:06:59 2014 - [info] Reading application default configuration from /etc/app1.cnf..
Tue Oct 21 11:06:59 2014 - [info] Reading server configuration from /etc/app1.cnf..
Tue Oct 21 11:06:59 2014 - [info] MHA::MasterMonitor version 0.56.
Tue Oct 21 11:07:00 2014 - [info] GTID failover mode = 0
Tue Oct 21 11:07:00 2014 - [info] Dead Servers:
Tue Oct 21 11:07:00 2014 - [info] Alive Servers:
Tue Oct 21 11:07:00 2014 - [info]   192.168.56.112(192.168.56.112:3306)
Tue Oct 21 11:07:00 2014 - [info]   192.168.56.110(192.168.56.110:3306)
Tue Oct 21 11:07:00 2014 - [info]   192.168.56.113(192.168.56.113:3306)
Tue Oct 21 11:07:00 2014 - [info] Alive Slaves:
Tue Oct 21 11:07:00 2014 - [info]   192.168.56.112(192.168.56.112:3306)  Version=5.5.40-36.1-log (oldest major version between slaves) log-bin:enabled
Tue Oct 21 11:07:00 2014 - [info]     Replicating from 192.168.56.110(192.168.56.110:3306)
Tue Oct 21 11:07:00 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 21 11:07:00 2014 - [info]   192.168.56.113(192.168.56.113:3306)  Version=5.6.21-69.0-log log-bin:enabled
Tue Oct 21 11:07:00 2014 - [info]     Replicating from 192.168.56.110(192.168.56.110:3306)
Tue Oct 21 11:07:00 2014 - [info]     Not candidate for the new Master (no_master is set)
Tue Oct 21 11:07:00 2014 - [info] Current Alive Master: 192.168.56.110(192.168.56.110:3306)
Tue Oct 21 11:07:00 2014 - [info] Checking slave configurations..
Tue Oct 21 11:07:00 2014 - [warning]  relay_log_purge=0 is not set on slave 192.168.56.112(192.168.56.112:3306).
Tue Oct 21 11:07:00 2014 - [info] Checking replication filtering settings..
Tue Oct 21 11:07:00 2014 - [info]  binlog_do_db= , binlog_ignore_db= 
Tue Oct 21 11:07:00 2014 - [info]  Replication filtering check ok.
Tue Oct 21 11:07:00 2014 - [info] GTID (with auto-pos) is not supported
Tue Oct 21 11:07:00 2014 - [info] Starting SSH connection tests..
Tue Oct 21 11:07:06 2014 - [info] All SSH connection tests passed successfully.
Tue Oct 21 11:07:06 2014 - [info] Checking MHA Node version..
Tue Oct 21 11:07:07 2014 - [info]  Version check ok.
Tue Oct 21 11:07:07 2014 - [info] Checking SSH publickey authentication settings on the current master..
Tue Oct 21 11:07:07 2014 - [info] HealthCheck: SSH to 192.168.56.110 is reachable.
Tue Oct 21 11:07:07 2014 - [info] Master MHA Node version is 0.56.
Tue Oct 21 11:07:07 2014 - [info] Checking recovery script configurations on 192.168.56.110(192.168.56.110:3306)..
Tue Oct 21 11:07:07 2014 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/var/lib/mysql,/var/log/mysql --output_file=/var/log/masterha/app1/save_binary_logs_test --manager_version=0.56 --start_file=561103306-bin.000010 
Tue Oct 21 11:07:07 2014 - [info]   Connecting to root@192.168.56.110(192.168.56.110:22).. 
  Creating /var/log/masterha/app1 if not exists..    ok.
  Checking output directory is accessible or not..
   ok.
  Binlog found at /var/lib/mysql, up to 561103306-bin.000010
Tue Oct 21 11:07:08 2014 - [info] Binlog setting check done.
Tue Oct 21 11:07:08 2014 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Tue Oct 21 11:07:08 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='yyf' --slave_host=192.168.56.112 --slave_ip=192.168.56.112 --slave_port=3306 --workdir=/var/log/masterha/app1 --target_version=5.5.40-36.1-log --manager_version=0.56 --relay_log_info=/var/lib/mysql/relay-log.info  --relay_dir=/var/lib/mysql/  --slave_pass=xxx
Tue Oct 21 11:07:08 2014 - [info]   Connecting to root@192.168.56.112(192.168.56.112:22).. 
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to mysqld-relay-bin.000002
    Temporary relay log file is /var/lib/mysql/mysqld-relay-bin.000002
    Testing mysql connection and privileges.. done.
    Testing mysqlbinlog output.. done.
    Cleaning up test file(s).. done.
Tue Oct 21 11:07:08 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='yyf' --slave_host=192.168.56.113 --slave_ip=192.168.56.113 --slave_port=3306 --workdir=/var/log/masterha/app1 --target_version=5.6.21-69.0-log --manager_version=0.56 --relay_log_info=/var/lib/mysql/relay-log.info  --relay_dir=/var/lib/mysql/  --slave_pass=xxx
Tue Oct 21 11:07:08 2014 - [info]   Connecting to root@192.168.56.113(192.168.56.113:22).. 
  Checking slave recovery environment settings..
    Opening /var/lib/mysql/relay-log.info ... ok.
    Relay log found at /var/lib/mysql, up to mysqld-relay-bin.000002
    Temporary relay log file is /var/lib/mysql/mysqld-relay-bin.000002
    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.
Tue Oct 21 11:07:17 2014 - [info] Slaves settings check done.
Tue Oct 21 11:07:17 2014 - [info] 
192.168.56.110(192.168.56.110:3306) (current master)
 +--192.168.56.112(192.168.56.112:3306)
 +--192.168.56.113(192.168.56.113:3306)
Tue Oct 21 11:07:17 2014 - [info] Checking replication health on 192.168.56.112..
Tue Oct 21 11:07:17 2014 - [info]  ok.
Tue Oct 21 11:07:17 2014 - [info] Checking replication health on 192.168.56.113..
Tue Oct 21 11:07:17 2014 - [info]  ok.
Tue Oct 21 11:07:17 2014 - [info] Checking master_ip_failover_script status:
Tue Oct 21 11:07:17 2014 - [info]   /root/scripts/master_ip_failover.sh --command=status --ssh_user=root --orig_master_host=192.168.56.110 --orig_master_ip=192.168.56.110 --orig_master_port=3306 
IN SCRIPT TEST====/etc/init.d/keepalived stop==/etc/init.d/keepalived start===
Checking the Status of the script.. OK 
Tue Oct 21 11:07:17 2014 - [info]  OK.
Tue Oct 21 11:07:17 2014 - [warning] shutdown_script is not defined.
Tue Oct 21 11:07:17 2014 - [info] Got exit code 0 (Not master dead).
MySQL Replication Health is OK.

posted on 2014-11-17 20:35  木林森2014 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/yiyuf/p/4104337.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值