MySQL MHA相关测试

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

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

SSH 信任关系检测:

[[email protected] 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 [email protected](192.168.56.110:22) to [email protected](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 [email protected](192.168.56.113:22) to [email protected](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

[[email protected] ~]# 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 [email protected](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 [email protected](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 [email protected](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.

时间: 2024-08-24 22:47:33

MySQL MHA相关测试的相关文章

MySQL MHA+Keepalived

一.MHA的简单介绍MHA是由perl语言编写的,用外挂脚本的方式实现mysql主从复制的高可用性.MHA可以自动检测mysql是否宕机,如果宕机,在10-30s内完成new master的选举,应用所有差异的binlog日志到所有slave,将所有的slave切换到新的master上来.MHA除了自动检测mysql是否宕机,还能够交互式的切换master,在日常的数据库维护中,这个功能还是挺有用的.由于MHA本身只负责数据库主从的切换,但是应用程序并不知道数据库的master变了.针对这种情况

MYSQL MHA

MYSQL MHA 简介: MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于 Facebook公司)开发,是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件.在MySQL故障切换过程中,MHA能做到在 0~30秒之内自动完成数据库的故障切换操作,并且在进行故障切换的过程中,MHA能在最大程度上保证数据的一致性,以达到真正意义上的高可用. 该软件由两部分组成:MHA

搭建MySQL MHA高可用

本文内容参考:http://www.ttlsa.com/mysql/step-one-by-one-deploy-mysql-mha-cluster/ MySQL MHA 高可用集群 环境: Linux: centos 6.6 MySQL: 5.5.49 MHA: mha4mysql-manager-0.56-0.el6.noarch.rpm(管理端) 以及 mha4mysql-node-0.56-0.el6.noarch.rpm(节点) 192.168.178.128 MySQL主从环境: M

MYSQL + MHA +keepalive + VIP安装配置(三)--keepalived安装配置

一.概述 keepalived介绍:Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web 服务器从系统中剔除,当web服务器工作正常后Keepalived自动将web服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人 工做的只是修复故障的web服务器. 二.环境 ? 1 2 3 vip:192.168.1.203\204 mysql-master:192.168.1.231 mysql-

CENTOS6.6 下mysql MHA架构搭建

本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn 摘要: 本篇是自己搭建的一篇mysql MHA文章 前面的安装步骤基本不变,后面的比如keepalived的配置文件有几种方法 其实想完成keepalived+lvs+atlas(mycat)+mha+mysql主从复制 这样的架构,只是MYCAT单独文章了 每个节点都关闭防火墙,SELINUX. 1.安装epel yum源 wget http://mirrors.

Mysql MHA 配置测试使用说明

Mysql MHA 使用说明 一.         MHA 简介 MHA,即Master High Availability Manager and Tools for MySQL,是日本的一位MySQL专家采用Perl语言编写的一个脚本管理工具,该工具仅适用于MySQL Replication(二层)环境,目的在于维持Master主库的高可用性. MHA(Master High Availability)是自动的master故障转移和Slave提升的软件包.它是基于标准的MySQL复制(异步/

Step By Step 搭建 MySql MHA 集群

关于MHA ?? MHA(Master High Availability)是一款开源的mysql高可用程序,目前在mysql高可用方面是一个相对成熟的解决方案.MHA 搭建的前提是MySQL集群中已经搭建了MySql Replication环境,有了Master/Slave节点.MHA的主要作用就是监测到Master节点故障时会提升主从复制环境中拥有最新数据的Slave节点成为新的master节点.同时,在切换master期间,MHA会通过从其他的Slave节点来获取额外的信息来避免一致性的问

Consul, ProxySQL and MySQL MHA(mysql 读写分离,高可用)

背景:mysql 官方目前没有提供比较成熟,稳定的高可用的方案,使得Mysql的高可用方案相对较少,一般都只有简单的主从,今天和大家分享一个Consul, ProxySQL and MySQL MHA架构的高可用方案: 架构特性:1,高可用2,读写分离,查询路由3,sql过滤等功能 Installation of Consul:Firstly, we'll need to install the required packages, download the Consul archive and

MySQL MHA应用实践(基础知识)

一.MHA概述MHA(Mater High Availability)是一套非常流行和实用的MySQL高可用解决方案软件,保证MySQL主从复制集群中主库的高可用性,保证集群业务不受影响.当master异常宕机后,MHA能够保证在1~30s的时间内实现故障转移,选择一个最优slave升为最新master,同时保持数据一致性的状态,以及将整个集群的所有数据损失降到最低.因此MHA方案十分受欢迎.二.MHA架构MHA由Manager(管理节点)和Node(数据节点)组成.Manager服务可以运行在