MHA切换检测日志分析

GTID模式

[root@db03 ~]# tail -f /etc/mha/manager.log
#在MySQL select ping:2006上出错(MySQL服务器已消失)
Tue Nov 19 17:52:00 2019 - [warning] Got error on MySQL select ping: 2006 (MySQL server has gone away)
#获得SSH检查脚本:退出0
Tue Nov 19 17:52:00 2019 - [info] Executing SSH check script: exit 0
# 健康检查:可以访问SSH到10.0.0.51
Tue Nov 19 17:52:00 2019 - [info] HealthCheck: SSH to 10.0.0.51 is reachable.
#在MySQL connect:2003上出现错误(无法连接到“10.0.0.51”(111)上的MySQL服务器)
Tue Nov 19 17:52:02 2019 - [warning] Got error on MySQL connect: 2003 (Can't connect to MySQL server on '10.0.0.51' (111))
#连接失败2次。。
Tue Nov 19 17:52:02 2019 - [warning] Connection failed 2 time(s)..
#在MySQL connect:2003上出现错误(无法连接到“10.0.0.51”(111)上的MySQL服务器)
Tue Nov 19 17:52:04 2019 - [warning] Got error on MySQL connect: 2003 (Can't connect to MySQL server on '10.0.0.51' (111))
#连接失败3次。。
Tue Nov 19 17:52:04 2019 - [warning] Connection failed 3 time(s)..
#在MySQL connect:2003上出现错误(无法连接到“10.0.0.51”(111)上的MySQL服务器)
Tue Nov 19 17:52:06 2019 - [warning] Got error on MySQL connect: 2003 (Can't connect to MySQL server on '10.0.0.51' (111))
#连接失败4次。。
Tue Nov 19 17:52:06 2019 - [warning] Connection failed 4 time(s)..
#无法从健康检查程序访问主服务器!
Tue Nov 19 17:52:06 2019 - [warning] Master is not reachable from health checker!
#无法访问Master 10.0.0.51(10.0.0.51:3306)!
Tue Nov 19 17:52:06 2019 - [warning] Master 10.0.0.51(10.0.0.51:3306) is not reachable!
#SSH是可访问的。
Tue Nov 19 17:52:06 2019 - [warning] SSH is reachable.
#连接到主服务器失败。再次读取配置文件/etc/masterha_default.cnf和/etc/mha/app1.cnf,并尝试连接到所有服务器以检查服务器状态。
Tue Nov 19 17:52:06 2019 - [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/mha/app1.cnf again, and trying to connect to all servers to check server status..
#未找到全局配置文件/etc/masterha/u default.cnf。跳过!
Tue Nov 19 17:52:06 2019 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
#正在从/etc/mha/app1.cnf.读取应用程序默认配置。。
Tue Nov 19 17:52:06 2019 - [info] Reading application default configuration from /etc/mha/app1.cnf..
# 正在从/etc/mha/app1.cnf.读取服务器配置。。
Tue Nov 19 17:52:06 2019 - [info] Reading server configuration from /etc/mha/app1.cnf..
#GTID故障转移模式=1
Tue Nov 19 17:52:07 2019 - [info] GTID failover mode = 1
#死机服务器:
Tue Nov 19 17:52:07 2019 - [info] Dead Servers:
#10.0.0.51(10.0.0.51:3306)
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.51(10.0.0.51:3306)
#活动服务器:
Tue Nov 19 17:52:07 2019 - [info] Alive Servers:
#10.0.0.52(10.0.0.52:3306)
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.52(10.0.0.52:3306)
#10.0.0.54(10.0.0.54:3306)
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.54(10.0.0.54:3306)
#10.0.0.53(10.0.0.53:3306)
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.53(10.0.0.53:3306)
#活着的奴隶:
Tue Nov 19 17:52:07 2019 - [info] Alive Slaves:
#10.0.0.52(10.0.0.52:3306)版本=5.6.44-log(从机之间的主要旧版本)日志箱:
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.52(10.0.0.52:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:07 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:07 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.54(10.0.0.54:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.54(10.0.0.54:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:07 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:07 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.53(10.0.0.53:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:07 2019 - [info] 10.0.0.53(10.0.0.53:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:07 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:07 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#检查从机配置。。
Tue Nov 19 17:52:07 2019 - [info] Checking slave configurations..
#只读=1未设置在从机10.0.0.52(10.0.0.52:3306)上。
Tue Nov 19 17:52:07 2019 - [info] read_only=1 is not set on slave 10.0.0.52(10.0.0.52:3306).
#只读=1未设置在从机10.0.0.54(10.0.0.54:3306)上。
Tue Nov 19 17:52:07 2019 - [info] read_only=1 is not set on slave 10.0.0.54(10.0.0.54:3306).
#只读=1未设置在从机10.0.0.53(10.0.0.53:3306)上。
Tue Nov 19 17:52:07 2019 - [info] read_only=1 is not set on slave 10.0.0.53(10.0.0.53:3306).
#正在检查复制筛选设置。。
Tue Nov 19 17:52:07 2019 - [info] Checking replication filtering settings..
#复制筛选检查正常。
Tue Nov 19 17:52:07 2019 - [info] Replication filtering check ok.
#主人倒下了!
Tue Nov 19 17:52:07 2019 - [info] Master is down!
#终止监视脚本。
Tue Nov 19 17:52:07 2019 - [info] Terminating monitoring script.
#获得退出代码20(主死亡)。
Tue Nov 19 17:52:07 2019 - [info] Got exit code 20 (Master dead).
#MHA::主故障转移版本0.56。
Tue Nov 19 17:52:07 2019 - [info] MHA::MasterFailover version 0.56.
#启动主故障转移。
Tue Nov 19 17:52:07 2019 - [info] Starting master failover.
Tue Nov 19 17:52:07 2019 - [info]
#*第1阶段:配置检查阶段。。
Tue Nov 19 17:52:07 2019 - [info] * Phase 1: Configuration Check Phase..
Tue Nov 19 17:52:07 2019 - [info]
#GTID故障转移模式=1
Tue Nov 19 17:52:08 2019 - [info] GTID failover mode = 1
#死机服务器:
Tue Nov 19 17:52:08 2019 - [info] Dead Servers:
#10.0.0.51(10.0.0.51:3306)
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.51(10.0.0.51:3306)
#通过MySQL检查主机可访问性(双重检查…)。。。
Tue Nov 19 17:52:08 2019 - [info] Checking master reachability via MySQL(double check)...
#好。
Tue Nov 19 17:52:08 2019 - [info] ok.
#活动服务器:
Tue Nov 19 17:52:08 2019 - [info] Alive Servers:
#10.0.0.52(10.0.0.52:3306)
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.52(10.0.0.52:3306)
#10.0.0.54(10.0.0.54:3306)
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.54(10.0.0.54:3306)
#10.0.0.53(10.0.0.53:3306)
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.53(10.0.0.53:3306)
#活奴隶:
Tue Nov 19 17:52:08 2019 - [info] Alive Slaves:
#10.0.0.52(10.0.0.52:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.52(10.0.0.52:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:08 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:08 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.54(10.0.0.54:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.54(10.0.0.54:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:08 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:08 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.53(10.0.0.53:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:08 2019 - [info] 10.0.0.53(10.0.0.53:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:08 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:08 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#启动基于GTID的故障转移。
Tue Nov 19 17:52:08 2019 - [info] Starting GTID based failover.
Tue Nov 19 17:52:08 2019 - [info]
#**第1阶段:配置检查阶段完成。
Tue Nov 19 17:52:08 2019 - [info] ** Phase 1: Configuration Check Phase completed.
Tue Nov 19 17:52:08 2019 - [info]
#*第2阶段:主停堆阶段。。
Tue Nov 19 17:52:08 2019 - [info] * Phase 2: Dead Master Shutdown Phase..
Tue Nov 19 17:52:08 2019 - [info]
#强制关闭,使应用程序永远无法连接到当前主服务器。。
Tue Nov 19 17:52:08 2019 - [info] Forcing shutdown so that applications never connect to the current master..
#[警告]未设置master_ip_failover_脚本。正在跳过失效的主IP地址
Tue Nov 19 17:52:08 2019 - [warning] master_ip_failover_script is not set. Skipping invalidating dead master IP address.
#[警告]关闭脚本未设置。跳过显式关闭已死亡的主控形状。
Tue Nov 19 17:52:08 2019 - [warning] shutdown_script is not set. Skipping explicit shutting down of the dead master.
#*第2阶段:主停堆阶段完成。
Tue Nov 19 17:52:09 2019 - [info] * Phase 2: Dead Master Shutdown Phase completed.
Tue Nov 19 17:52:09 2019 - [info]
#*第3阶段:主恢复阶段。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 3: Master Recovery Phase..
Tue Nov 19 17:52:09 2019 - [info]
#*第3.1阶段:获取最新的从属阶段。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 3.1: Getting Latest Slaves Phase..
Tue Nov 19 17:52:09 2019 - [info]
#所有从属服务器上的最新二进制日志文件/位置是mysql bin.000005:191
Tue Nov 19 17:52:09 2019 - [info] The latest binary log file/position on all slaves is mysql-bin.000005:191
#检索到Gtid集:6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
Tue Nov 19 17:52:09 2019 - [info] Retrieved Gtid Set: 6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
#最新从属服务器(接收到最新中继日志文件的从属服务器):
Tue Nov 19 17:52:09 2019 - [info] Latest slaves (Slaves that received relay log files to the latest):
#10.0.0.52(10.0.0.52:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.52(10.0.0.52:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.54(10.0.0.54:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.54(10.0.0.54:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.53(10.0.0.53:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.53(10.0.0.53:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#所有从机上最早的二进制日志文件/位置是mysql bin.000005:191
Tue Nov 19 17:52:09 2019 - [info] The oldest binary log file/position on all slaves is mysql-bin.000005:191
#检索到Gtid集:6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
Tue Nov 19 17:52:09 2019 - [info] Retrieved Gtid Set: 6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
#最老的奴隶:
Tue Nov 19 17:52:09 2019 - [info] Oldest slaves:
#10.0.0.52(10.0.0.52:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.52(10.0.0.52:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.54(10.0.0.54:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.54(10.0.0.54:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
#10.0.0.53(10.0.0.53:3306)版本=5.6.44-log(从机之间最旧的主版本)日志箱:启用
Tue Nov 19 17:52:09 2019 - [info] 10.0.0.53(10.0.0.53:3306) Version=5.6.44-log (oldest major version between slaves) log-bin:enabled
#GTID开启
Tue Nov 19 17:52:09 2019 - [info] GTID ON
#从10.0.0.51复制(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info] Replicating from 10.0.0.51(10.0.0.51:3306)
Tue Nov 19 17:52:09 2019 - [info]
#*第3.3阶段:确定新的主阶段。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 3.3: Determining New Master Phase..
Tue Nov 19 17:52:09 2019 - [info]
#从奴隶中搜索新的主。。
Tue Nov 19 17:52:09 2019 - [info] Searching new master from slaves..
#配置文件中的候选主控形状:
Tue Nov 19 17:52:09 2019 - [info] Candidate masters from the configuration file:
#非候选硕士:
Tue Nov 19 17:52:09 2019 - [info] Non-candidate masters:
#新主机为10.0.0.52(10.0.0.52:3306)
Tue Nov 19 17:52:09 2019 - [info] New master is 10.0.0.52(10.0.0.52:3306)
#启动主故障转移。。
Tue Nov 19 17:52:09 2019 - [info] Starting master failover..
Tue Nov 19 17:52:09 2019 - [info]
#发件人:
From:
#10.0.0.51(10.0.0.51:3306)(当前主控)
10.0.0.51(10.0.0.51:3306) (current master)
+--10.0.0.52(10.0.0.52:3306)
+--10.0.0.54(10.0.0.54:3306)
+--10.0.0.53(10.0.0.53:3306)
#致:
To:
#10.0.0.52(10.0.0.52:3306)(新母版)
10.0.0.52(10.0.0.52:3306) (new master)
+--10.0.0.54(10.0.0.54:3306)
+--10.0.0.53(10.0.0.53:3306)
Tue Nov 19 17:52:09 2019 - [info]
#*第3.3阶段:新主恢复阶段。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 3.3: New Master Recovery Phase..
Tue Nov 19 17:52:09 2019 - [info]
#等待应用所有日志。。
Tue Nov 19 17:52:09 2019 - [info] Waiting all logs to be applied..
#完成。
Tue Nov 19 17:52:09 2019 - [info] done.
#获取新主人的binlog名称和位置。。
Tue Nov 19 17:52:09 2019 - [info] Getting new master's binlog name and position..
#mysql bin.000002:438
Tue Nov 19 17:52:09 2019 - [info] mysql-bin.000002:438
#所有其他从属服务器应从此处开始复制。语句应该是:CHANGE MASTER
Tue Nov 19 17:52:09 2019 - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='10.0.0.52', MASTER_PORT=3306, MASTER_AUTO_POSITION=1, MASTER_USER='slave', MASTER_PASSWORD='xxx';
#主恢复成功。文件:Pos:Exec_Gtid_Set:mysql-bin.000002、438、6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
Tue Nov 19 17:52:09 2019 - [info] Master Recovery succeeded. File:Pos:Exec_Gtid_Set: mysql-bin.000002, 438, 6e607afa-0a67-11ea-ac08-000c29f3321a:1-2
#[警告]未设置master_ip_failover_脚本。正在跳过接管新的主IP地址。
Tue Nov 19 17:52:09 2019 - [warning] master_ip_failover_script is not set. Skipping taking over new master IP address.
#**已成功完成主恢复。
Tue Nov 19 17:52:09 2019 - [info] ** Finished master recovery successfully.
#*第3阶段:主恢复阶段完成。
Tue Nov 19 17:52:09 2019 - [info] * Phase 3: Master Recovery Phase completed.
Tue Nov 19 17:52:09 2019 - [info]
#*第4阶段:从机恢复阶段。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 4: Slaves Recovery Phase..
Tue Nov 19 17:52:09 2019 - [info]
Tue Nov 19 17:52:09 2019 - [info]
#*第4.1阶段:并行启动从机。。
Tue Nov 19 17:52:09 2019 - [info] * Phase 4.1: Starting Slaves in parallel..
Tue Nov 19 17:52:09 2019 - [info]
#——主机10.0.0.54(10.0.0.54:3306)上的从机恢复已启动,pid:22464。如果需要时间,请检查tmp log/etc/mha/app1/10.0.0.54_3306_20191119175207.log。。
Tue Nov 19 17:52:09 2019 - [info] -- Slave recovery on host 10.0.0.54(10.0.0.54:3306) started, pid: 22464. Check tmp log /etc/mha/app1/10.0.0.54_3306_20191119175207.log if it takes time..
#]——主机10.0.0.53(10.0.0.53:3306)上的从机恢复已启动,pid:22465。如果需要时间,请检查tmp log/etc/mha/app1/10.0.0.53_3306_20191119175207.log。。
Tue Nov 19 17:52:09 2019 - [info] -- Slave recovery on host 10.0.0.53(10.0.0.53:3306) started, pid: 22465. Check tmp log /etc/mha/app1/10.0.0.53_3306_20191119175207.log if it takes time..
Tue Nov 19 17:52:10 2019 - [info]
#记录来自10.0.0.54的消息。。。
Tue Nov 19 17:52:10 2019 - [info] Log messages from 10.0.0.54 ...
Tue Nov 19 17:52:10 2019 - [info]
#重置从机10.0.0.54(10.0.0.54:3306)并从新主机10.0.0.52(10.0.0.52:3306)开始复制。。
Tue Nov 19 17:52:09 2019 - [info] Resetting slave
10.0.0.54(10.0.0.54:3306) and starting replication from the new master 10.0.0.52(10.0.0.52:3306)..
#执行变更主控。
Tue Nov 19 17:52:09 2019 - [info] Executed CHANGE MASTER.
#从系统启动。
Tue Nov 19 17:52:09 2019 - [info] Slave started.
#gtid_wait(6e607afa-0a67-11ea-ac08-000c29f3321a:1-2)10.0.0.54(10.0.0.54:3306)完成。执行了0个事件。
Tue Nov 19 17:52:09 2019 - [info] gtid_wait(6e607afa-0a67-11ea-ac08-000c29f3321a:1-2) completed on 10.0.0.54(10.0.0.54:3306). Executed 0 events.
#10.0.0.54的日志消息结束。
Tue Nov 19 17:52:10 2019 - [info] End of log messages from 10.0.0.54.
#——主机10.0.0.54(10.0.0.54:3306)上的从机已启动。
Tue Nov 19 17:52:10 2019 - [info] -- Slave on host 10.0.0.54(10.0.0.54:3306) started.
Tue Nov 19 17:52:11 2019 - [info]
#10.0.0.53中的日志消息。。。
Tue Nov 19 17:52:11 2019 - [info] Log messages from 10.0.0.53 ...
Tue Nov 19 17:52:11 2019 - [info]
#重置从机10.0.0.53(10.0.0.53:3306)并从新主机10.0.0.52(10.0.0.52:3306)开始复制。。
Tue Nov 19 17:52:09 2019 - [info] Resetting slave
10.0.0.53(10.0.0.53:3306) and starting replication from the new master 10.0.0.52(10.0.0.52:3306)..
#执行变更主控。
Tue Nov 19 17:52:09 2019 - [info] Executed CHANGE MASTER.
#奴隶启动。
Tue Nov 19 17:52:10 2019 - [info] Slave started.
#gtid_wait(6e607afa-0a67-11ea-ac08-000c29f3321a:1-2)10.0.0.53(10.0.0.53:3306)完成。执行了0个事件。
Tue Nov 19 17:52:10 2019 - [info] gtid_wait(6e607afa-0a67-11ea-ac08-000c29f3321a:1-2) completed on 10.0.0.53(10.0.0.53:3306). Executed 0 events.
#10.0.0.53的日志消息结束。
Tue Nov 19 17:52:11 2019 - [info] End of log messages from 10.0.0.53.
#——主机10.0.0.53(10.0.0.53:3306)上的从机已启动。
Tue Nov 19 17:52:11 2019 - [info] -- Slave on host 10.0.0.53(10.0.0.53:3306) started.
#所有新的从属服务器已成功恢复。
Tue Nov 19 17:52:11 2019 - [info] All new slave servers recovered successfully.
Tue Nov 19 17:52:11 2019 - [info]
#*第5阶段:新的主清理阶段。。
Tue Nov 19 17:52:11 2019 - [info] * Phase 5: New master cleanup phase..
Tue Nov 19 17:52:11 2019 - [info]
#在新主机上重置从机信息。。
Tue Nov 19 17:52:11 2019 - [info] Resetting slave info on the new master..
#10.0.0.52:重置从机信息成功。
Tue Nov 19 17:52:11 2019 - [info] 10.0.0.52: Resetting slave info succeeded.
#主故障转移到10.0.0.52(10.0.0.52:3306)成功完成。
Tue Nov 19 17:52:11 2019 - [info] Master failover to 10.0.0.52(10.0.0.52:3306) completed successfully.
#从/etc/mha/app1.cnf中删除了server1条目。
Tue Nov 19 17:52:11 2019 - [info] Deleted server1 entry from /etc/mha/app1.cnf .
Tue Nov 19 17:52:11 2019 - [info]
#-----故障转移报告-----
----- Failover Report -----
#app1:MySQL主故障转移10.0.0.51(10.0.0.51:3306)到10.0.0.52(10.0.0.52:3306)成功
app1: MySQL Master failover 10.0.0.51(10.0.0.51:3306) to 10.0.0.52(10.0.0.52:3306) succeeded
#大师10.0.0.51(10.0.0.51:3306)倒下了!
Master 10.0.0.51(10.0.0.51:3306) is down!
#有关详细信息,请查看位于db03:/etc/MHA/Manager.log的MHA Manager日志。
Check MHA Manager logs at db03:/etc/mha/manager.log for details.
#已启动自动(非交互式)故障转移。
Started automated(non-interactive) failover.
#选择10.0.0.52(10.0.0.52:3306)作为新的主控形状。
Selected 10.0.0.52(10.0.0.52:3306) as a new master.
#10.0.0.52(10.0.0.52:3306):确定:应用所有日志成功。
10.0.0.52(10.0.0.52:3306): OK: Applying all logs succeeded.
#10.0.0.54(10.0.0.54:3306):确定:从机启动,从10.0.0.52(10.0.0.52:3306)复制
10.0.0.54(10.0.0.54:3306): OK: Slave started, replicating from 10.0.0.52(10.0.0.52:3306)
#10.0.0.53(10.0.0.53:3306):确定:从机启动,从10.0.0.52(10.0.0.52:3306)复制
10.0.0.53(10.0.0.53:3306): OK: Slave started, replicating from 10.0.0.52(10.0.0.52:3306)
#10.0.0.52(10.0.0.52:3306):重置从机信息成功。
10.0.0.52(10.0.0.52:3306): Resetting slave info succeeded.
#已成功完成到10.0.0.52(10.0.0.52:3306)的主故障转移。
Master failover to 10.0.0.52(10.0.0.52:3306) completed successfully.

普通模式

#发件人:
From:
#10.0.0.51(10.0.0.51:3306)(当前主控)
10.0.0.51(10.0.0.51:3306) (current master)
+--10.0.0.52(10.0.0.52:3306)
+--10.0.0.54(10.0.0.54:3306)
+--10.0.0.53(10.0.0.53:3306) #致:
To:
#10.0.0.52(10.0.0.52:3306)(新母版)
10.0.0.52(10.0.0.52:3306) (new master)
+--10.0.0.54(10.0.0.54:3306)
+--10.0.0.53(10.0.0.53:3306)
Tue Nov 19 19:22:21 2019 - [info]
#*第3.3阶段:新主差异日志生成阶段。。
Tue Nov 19 19:22:21 2019 - [info] * Phase 3.3: New Master Diff Log Generation Phase..
Tue Nov 19 19:22:21 2019 - [info]
#此服务器具有所有中继日志。不需要从最新的从机生成diff文件。
Tue Nov 19 19:22:21 2019 - [info] This server has all relay logs. No need to generate diff files from the latest slave.
#发送binlog。。
Tue Nov 19 19:22:21 2019 - [info] Sending binlog.. Tue Nov 19 19:22:22 2019 - [info] scp from local:/etc/mha/app1/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog to root@10.0.0.52:/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog succeeded.
Tue Nov 19 19:22:22 2019 - [info]
#*第3.4阶段:主日志应用阶段。。
Tue Nov 19 19:22:22 2019 - [info] * Phase 3.4: Master Log Apply Phase..
Tue Nov 19 19:22:22 2019 - [info]
#*注意:如果在此阶段发生任何错误,则需要手动恢复。
Tue Nov 19 19:22:22 2019 - [info] *NOTICE: If any error happens from this phase, manual recovery is needed.
#10.0.0.52(10.0.0.52:3306)开始恢复。。
Tue Nov 19 19:22:22 2019 - [info] Starting recovery on 10.0.0.52(10.0.0.52:3306)..
#生成差异成功。
Tue Nov 19 19:22:22 2019 - [info] Generating diffs succeeded.
#等待所有中继日志应用。
Tue Nov 19 19:22:22 2019 - [info] Waiting until all relay logs are applied.
#完成。
Tue Nov 19 19:22:22 2019 - [info] done.
#获取奴隶状态。。
Tue Nov 19 19:22:22 2019 - [info] Getting slave status..
#此从机(10.0.0.52)的Exec_Master_Log_Pos等于Read_Master_Log_Pos(mysql bin.000006:120)。无需从Exec_Master_Log_Pos恢复。
Tue Nov 19 19:22:22 2019 - [info] This slave(10.0.0.52)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000006:120). No need to recover from Exec_Master_Log_Pos.
#连接到目标从属主机10.0.0.52,运行恢复脚本。。
Tue Nov 19 19:22:22 2019 - [info] Connecting to the target slave host 10.0.0.52, running recover script..
#执行命令:
Tue Nov 19 19:22:22 2019 - [info] Executing command: apply_diff_relay_logs --command=apply --slave_user='mha' --slave_host=10.0.0.52 --slave_ip=10.0.0.52 --slave_port=3306 --apply_files=/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog --workdir=/var/tmp --target_version=5.6.44-log --timestamp=20191119192216 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.56 --slave_pass=xxx
Tue Nov 19 19:22:22 2019 - [info]
#MySQL客户端版本是5.6.44。使用--二进制模式。应用差分二进制/中继日志文件/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.52:3306。这可能需要很长时间。。。
MySQL client version is 5.6.44. Using --binary-mode.
Applying differential binary/relay log files /var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.52:3306. This may take long time...
#应用日志文件成功。
Applying log files succeeded.
#所有中继日志均已成功应用。
Tue Nov 19 19:22:22 2019 - [info] All relay logs were successfully applied.
#获取新主人的binlog名称和位置。。
Tue Nov 19 19:22:22 2019 - [info] Getting new master's binlog name and position..
Tue Nov 19 19:22:22 2019 - [info] mysql-bin.000003:120
#所有其他从机应从此处开始复制。语句应该是:
Tue Nov 19 19:22:22 2019 - [info] All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='10.0.0.52', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000003', MASTER_LOG_POS=120, MASTER_USER='slave', MASTER_PASSWORD='xxx';
#-[警告]未设置master_ip_failover_脚本。正在跳过接管新的主IP地址。
Tue Nov 19 19:22:22 2019 - [warning] master_ip_failover_script is not set. Skipping taking over new master IP address.
#**已成功完成主恢复。
Tue Nov 19 19:22:22 2019 - [info] ** Finished master recovery successfully.
#*第3阶段:主恢复阶段完成。
Tue Nov 19 19:22:22 2019 - [info] * Phase 3: Master Recovery Phase completed.
Tue Nov 19 19:22:22 2019 - [info]
#*第4阶段:奴隶恢复阶段。。
Tue Nov 19 19:22:22 2019 - [info] * Phase 4: Slaves Recovery Phase..
Tue Nov 19 19:22:22 2019 - [info]
#*第4.1阶段:启动并行从Diff日志生成阶段。。
Tue Nov 19 19:22:22 2019 - [info] * Phase 4.1: Starting Parallel Slave Diff Log Generation Phase..
Tue Nov 19 19:22:22 2019 - [info]
#——主机10.0.0.54(10.0.0.54:3306)上的从属差异文件生成已启动,pid:23478。如果需要时间,请检查tmp log/etc/mha/app1/10.0.0.54_3306_20191119192216.log。。
Tue Nov 19 19:22:22 2019 - [info] -- Slave diff file generation on host 10.0.0.54(10.0.0.54:3306) started, pid: 23478. Check tmp log /etc/mha/app1/10.0.0.54_3306_20191119192216.log if it takes time..
#——主机10.0.0.53(10.0.0.53:3306)上的从属差异文件生成已启动,pid:23479。如果需要时间,请检查tmp log/etc/mha/app1/10.0.0.53_3306_20191119192216.log。。
Tue Nov 19 19:22:22 2019 - [info] -- Slave diff file generation on host 10.0.0.53(10.0.0.53:3306) started, pid: 23479. Check tmp log
/etc/mha/app1/10.0.0.53_3306_20191119192216.log if it takes time..
Tue Nov 19 19:22:23 2019 - [info]
#10.0.0.54中的日志消息。。。
Tue Nov 19 19:22:23 2019 - [info] Log messages from 10.0.0.54 ...
Tue Nov 19 19:22:23 2019 - [info]
#此服务器具有所有中继日志。不需要从最新的从机生成diff文件。
Tue Nov 19 19:22:22 2019 - [info] This server has all relay logs. No need to generate diff files from the latest slave.
#10.0.0.54的日志消息结束。
Tue Nov 19 19:22:23 2019 - [info] End of log messages from 10.0.0.54.
#-10.0.0.54(10.0.0.54:3306)有最新的中继日志事件。
Tue Nov 19 19:22:23 2019 - [info] -- 10.0.0.54(10.0.0.54:3306) has the latest relay log events.
Tue Nov 19 19:22:23 2019 - [info]
#10.0.0.53中的日志消息。。。
Tue Nov 19 19:22:23 2019 - [info] Log messages from 10.0.0.53 ...
Tue Nov 19 19:22:23 2019 - [info]
#此服务器具有所有中继日志。不需要从最新的从机生成diff文件。
Tue Nov 19 19:22:22 2019 - [info] This server has all relay logs. No need to generate diff files from the latest slave.
#10.0.0.53的日志消息结束。
Tue Nov 19 19:22:23 2019 - [info] End of log messages from 10.0.0.53.
#-10.0.0.53(10.0.0.53:3306)有最新的中继日志事件。
Tue Nov 19 19:22:23 2019 - [info] -- 10.0.0.53(10.0.0.53:3306) has the latest relay log events.
#从最新的从机生成中继diff文件成功。
Tue Nov 19 19:22:23 2019 - [info] Generating relay diff files from the latest slave succeeded.
Tue Nov 19 19:22:23 2019 - [info]
#*第4.2阶段:启动并行从日志应用阶段。。
Tue Nov 19 19:22:23 2019 - [info] * Phase 4.2: Starting Parallel Slave Log Apply Phase..
Tue Nov 19 19:22:23 2019 - [info]
#——主机10.0.0.54(10.0.0.54:3306)上的从机恢复已启动,pid:23482。检查tmp日志
Tue Nov 19 19:22:23 2019 - [info] -- Slave recovery on host 10.0.0.54(10.0.0.54:3306) started, pid: 23482. Check tmp log /etc/mha/app1/10.0.0.54_3306_20191119192216.log if it takes time..
Tue Nov 19 19:22:23 2019 - [info] -- Slave recovery on host 10.0.0.53(10.0.0.53:3306) started, pid: 23483. Check tmp log /etc/mha/app1/10.0.0.53_3306_20191119192216.log if it takes time..
Tue Nov 19 19:22:24 2019 - [info]
#记录来自10.0.0.54的消息。。。
Tue Nov 19 19:22:24 2019 - [info] Log messages from 10.0.0.54 ...
Tue Nov 19 19:22:24 2019 - [info]
#发送binlog。。
Tue Nov 19 19:22:23 2019 - [info] Sending binlog..
Tue Nov 19 19:22:23 2019 - [info] scp from local:/etc/mha/app1/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog to root@10.0.0.54:/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog succeeded.
#10.0.0.54(10.0.0.54:3306)开始恢复。。
Tue Nov 19 19:22:23 2019 - [info] Starting recovery on 10.0.0.54(10.0.0.54:3306)..
#生成差异成功。
Tue Nov 19 19:22:23 2019 - [info] Generating diffs succeeded.
#等待所有中继日志应用。
Tue Nov 19 19:22:23 2019 - [info] Waiting until all relay logs are applied.
#完成。
Tue Nov 19 19:22:23 2019 - [info] done.
#获取奴隶状态。。
Tue Nov 19 19:22:23 2019 - [info] Getting slave status..
#此从机(10.0.0.54)的Exec_Master_Log_Pos等于Read_Master_Log_Pos(mysql bin.000006:120)。无需从Exec_Master_Log_Pos恢复。
Tue Nov 19 19:22:23 2019 - [info] This slave(10.0.0.54)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000006:120). No need to recover from Exec_Master_Log_Pos.
#连接到目标从属主机10.0.0.54,运行恢复脚本。。
Tue Nov 19 19:22:23 2019 - [info] Connecting to the target slave host 10.0.0.54, running recover script..
#执行命令:
Tue Nov 19 19:22:23 2019 - [info] Executing command: apply_diff_relay_logs --command=apply --slave_user='mha' --slave_host=10.0.0.54 --slave_ip=10.0.0.54 --slave_port=3306 --apply_files=/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog --workdir=/var/tmp --target_version=5.6.44-log --timestamp=20191119192216 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.56 --slave_pass=xxx
Tue Nov 19 19:22:24 2019 - [info]
#MySQL客户端版本是5.6.44。使用--二进制模式。应用差分二进制/中继日志文件/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.54:3306。这可能需要很长时间。。。 应用日志文件成功。
MySQL client version is 5.6.44. Using --binary-mode.
Applying differential binary/relay log files /var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.54:3306. This may take long time...
Applying log files succeeded. #所有中继日志均已成功应用。
Tue Nov 19 19:22:24 2019 - [info] All relay logs were successfully applied.
#重置从机10.0.0.54(10.0.0.54:3306)并从新主机10.0.0.52(10.0.0.52:3306)开始复制。。
Tue Nov 19 19:22:24 2019 - [info] Resetting slave 10.0.0.54(10.0.0.54:3306) and starting replication from the new master 10.0.0.52(10.0.0.52:3306)..
#执行变更主控。
Tue Nov 19 19:22:24 2019 - [info] Executed CHANGE MASTER.
#奴隶启动。
Tue Nov 19 19:22:24 2019 - [info] Slave started.
#10.0.0.54的日志消息结束。
Tue Nov 19 19:22:24 2019 - [info] End of log messages from 10.0.0.54.
#——主机10.0.0.54(10.0.0.54:3306)上的从机恢复成功。
Tue Nov 19 19:22:24 2019 - [info] -- Slave recovery on host 10.0.0.54(10.0.0.54:3306) succeeded.
Tue Nov 19 19:22:25 2019 - [info]
#记录来自10.0.0.53的消息。。。
Tue Nov 19 19:22:25 2019 - [info] Log messages from 10.0.0.53 ...
Tue Nov 19 19:22:25 2019 - [info]
#发送binlog。。
Tue Nov 19 19:22:23 2019 - [info] Sending binlog..
Tue Nov 19 19:22:24 2019 - [info] scp from local:/etc/mha/app1/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog to root@10.0.0.53:/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog succeeded.
#10.0.0.53(10.0.0.53:3306)开始恢复。。
Tue Nov 19 19:22:24 2019 - [info] Starting recovery on 10.0.0.53(10.0.0.53:3306)..
#生成差异成功。
Tue Nov 19 19:22:24 2019 - [info] Generating diffs succeeded.
#等待所有中继日志应用。
Tue Nov 19 19:22:24 2019 - [info] Waiting until all relay logs are applied.
#完成。
Tue Nov 19 19:22:24 2019 - [info] done.
#获取奴隶状态。。
Tue Nov 19 19:22:24 2019 - [info] Getting slave status..
#此从机(10.0.0.53)的Exec_Master_Log_Pos等于Read_Master_Log_Pos(mysql bin.000006:120)。无需从Exec_Master_Log_Pos恢复。
Tue Nov 19 19:22:24 2019 - [info] This slave(10.0.0.53)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000006:120). No need to recover from Exec_Master_Log_Pos.
#连接到目标从属主机10.0.0.53,运行恢复脚本。。
Tue Nov 19 19:22:24 2019 - [info] Connecting to the target slave host 10.0.0.53, running recover script..
#执行命令:
Tue Nov 19 19:22:24 2019 - [info] Executing command: apply_diff_relay_logs --command=apply --slave_user='mha' --slave_host=10.0.0.53 --slave_ip=10.0.0.53 --slave_port=3306 --apply_files=/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog --workdir=/var/tmp --target_version=5.6.44-log --timestamp=20191119192216 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.56 --slave_pass=xxx
Tue Nov 19 19:22:24 2019 - [info]
#MySQL客户端版本是5.6.44。使用--二进制模式。应用差分二进制/中继日志文件/var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.53:3306。这可能需要很长时间。。。应用日志文件成功。
MySQL client version is 5.6.44. Using --binary-mode.
Applying differential binary/relay log files /var/tmp/saved_master_binlog_from_10.0.0.51_3306_20191119192216.binlog on 10.0.0.53:3306. This may take long time...
Applying log files succeeded. #所有中继日志均已成功应用。
Tue Nov 19 19:22:24 2019 - [info] All relay logs were successfully applied.
#重置从机10.0.0.53(10.0.0.53:3306)并从新主机10.0.0.52(10.0.0.52:3306)开始复制。。
Tue Nov 19 19:22:24 2019 - [info] Resetting slave 10.0.0.53(10.0.0.53:3306) and starting replication from the new master 10.0.0.52(10.0.0.52:3306)..
#执行变更主控。
Tue Nov 19 19:22:24 2019 - [info] Executed CHANGE MASTER.
#奴隶启动。
Tue Nov 19 19:22:24 2019 - [info] Slave started.
#10.0.0.53的日志消息结束。
Tue Nov 19 19:22:25 2019 - [info] End of log messages from 10.0.0.53.
#——主机10.0.0.53(10.0.0.53:3306)上的从机恢复成功。
Tue Nov 19 19:22:25 2019 - [info] -- Slave recovery on host 10.0.0.53(10.0.0.53:3306) succeeded.
#所有新的从属服务器已成功恢复。
Tue Nov 19 19:22:25 2019 - [info] All new slave servers recovered successfully.
Tue Nov 19 19:22:25 2019 - [info]
#*第5阶段:新的主清理阶段。。
Tue Nov 19 19:22:25 2019 - [info] * Phase 5: New master cleanup phase..
Tue Nov 19 19:22:25 2019 - [info]
#在新主机上重置从机信息。。
Tue Nov 19 19:22:25 2019 - [info] Resetting slave info on the new master..
#10.0.0.52:重置从机信息成功。
Tue Nov 19 19:22:25 2019 - [info] 10.0.0.52: Resetting slave info succeeded.
#主故障转移到10.0.0.52(10.0.0.52:3306)成功完成。
Tue Nov 19 19:22:25 2019 - [info] Master failover to 10.0.0.52(10.0.0.52:3306) completed successfully.
#从/etc/mha/app1.cnf中删除了server1条目。
Tue Nov 19 19:22:25 2019 - [info] Deleted server1 entry from /etc/mha/app1.cnf .
Tue Nov 19 19:22:25 2019 - [info] #-----故障转移报告-----
----- Failover Report -----
#app1:MySQL主故障转移10.0.0.51(10.0.0.51:3306)到10.0.0.52(10.0.0.52:3306)成功
app1: MySQL Master failover 10.0.0.51(10.0.0.51:3306) to 10.0.0.52(10.0.0.52:3306) succeeded
#大师10.0.0.51(10.0.0.51:3306)倒下了!
Master 10.0.0.51(10.0.0.51:3306) is down!
#有关详细信息,请查看位于db03:/etc/MHA/Manager.log的MHA Manager日志。
Check MHA Manager logs at db03:/etc/mha/manager.log for details.
#已启动自动(非交互式)故障转移。
Started automated(non-interactive) failover.
#最新的从机10.0.0.52(10.0.0.52:3306)具有用于恢复的所有中继日志。
The latest slave 10.0.0.52(10.0.0.52:3306) has all relay logs for recovery.
#选择10.0.0.52(10.0.0.52:3306)作为新的主控形状。
Selected 10.0.0.52(10.0.0.52:3306) as a new master.
#10.0.0.52(10.0.0.52:3306):确定:应用所有日志成功。
10.0.0.52(10.0.0.52:3306): OK: Applying all logs succeeded.
#10.0.0.54(10.0.0.54:3306):此主机具有最新的中继日志事件。
10.0.0.54(10.0.0.54:3306): This host has the latest relay log events.
#10.0.0.53(10.0.0.53:3306):此主机具有最新的中继日志事件。
10.0.0.53(10.0.0.53:3306): This host has the latest relay log events.
#从最新的从机生成中继diff文件成功。
Generating relay diff files from the latest slave succeeded.
#10.0.0.54(10.0.0.54:3306):确定:应用所有日志成功。从机启动,从10.0.0.52复制(10.0.0.52:3306)
10.0.0.54(10.0.0.54:3306): OK: Applying all logs succeeded. Slave started, replicating from 10.0.0.52(10.0.0.52:3306)
#10.0.0.53(10.0.0.53:3306):确定:应用所有日志成功。从机启动,从10.0.0.52复制(10.0.0.52:3306)
10.0.0.53(10.0.0.53:3306): OK: Applying all logs succeeded. Slave started, replicating from 10.0.0.52(10.0.0.52:3306)
#10.0.0.52(10.0.0.52:3306):重置从机信息成功。已成功完成到10.0.0.52(10.0.0.52:3306)的主故障转移。
10.0.0.52(10.0.0.52:3306): Resetting slave info succeeded.
Master failover to 10.0.0.52(10.0.0.52:3306) completed successfully.

MySQL--19 MHA切换日志分析的更多相关文章

  1. MHA ssh检查,repl复制检查和在线切换日志分析

    一.SSh 检查日志分析 执行过程及对应的日志: 1.读取MHA manger 节点上的配置文件 2.根据配置文件,得到各个主机的信息,逐一进行SSH检查 3.每个主机都通过SSH连接除了自己以外的其 ...

  2. MySQL 数据库慢查询日志分析脚本

    这个脚本是基于pt-query-digest做的日志分析脚本,变成可视化的格式. 目录结构是 ./mysql_data/log./mysql_data/log/tmp./slow_query # co ...

  3. MySQL Slow Log慢日志分析【转】

    如果你的MySQL出现了性能问题,第一个需要“诊断”的就是slow log(慢日志)了. slow log文件很小,使用more less等命令就足够了.如果slow log很大怎么办?这里介绍MyS ...

  4. MySQL之慢查询日志分析

    在MySQL命令行中查看慢查询日志是否打开了: mysql> show variables like '%slow_query%'; +---------------------------+- ...

  5. mysql使用慢查询日志分析数据执行情况

    #查询慢查询日志文件路径show variables like '%slow_query%';#开启慢查询日志 ; #设置慢查询阀值为0,将所有的语句都记入慢查询日志 ;#未使用索引的查询也被记录到慢 ...

  6. MHA 主从切换过程及日志分析

    本文主要在MHA 切换日志的角度分析MHA切换的过.MHA故障切换过程如下图所示 第一部分:开启MHA 监控 通过分析日志,得到以下步骤: 1.读取MHA manager 节点的配置文件,并检查配置文 ...

  7. 慢查询日志分析(mysql)

    开启慢查询日志之后,慢查询sql会被存到数据库系统表mysql.slow_log或是文件中,可参考.有两个工具可以帮助我们分析输出报告,分别是mysqldumpslow和pt-query-digest ...

  8. mysql慢查询开启及分析方法

    最近服务维护的公司的DB服务器,总是会出现问题,感觉需要优化一下了,登陆上去,发现慢查询日志都没有开,真是惭愧, 故果断加上慢查询日志, 经过分析sql记录,发现问题很多,开发人员很多没有对sql优化 ...

  9. mysql性能优化-慢查询分析、优化索引和配置 (慢查询日志,explain,profile)

    mysql性能优化-慢查询分析.优化索引和配置 (慢查询日志,explain,profile) 一.优化概述 二.查询与索引优化分析 1性能瓶颈定位 Show命令 慢查询日志 explain分析查询 ...

随机推荐

  1. Java中的Overload和Override有什么区别

    Overload和Override的区别 1.Overload 定义 Overload是重载的意思.它是指我们可以定义一些名称相同的方法,通过定义不同的输入参数来区分这些方法,然后在调用时,虚拟机就会 ...

  2. [洛谷P1709] 隐藏的口令

    问题描述 有时候程序员有很奇怪的方法来隐藏他们的口令.Binny会选择一个字符串S(由N个小写字母组成,5<=N<=5,000,000),然后他把S顺时针绕成一个圈,每次取一个做开头字母并 ...

  3. 20 简述BASE64编码的作用和c#对其的支持?

  4. php array_intersect()函数 语法

    php array_intersect()函数 语法 作用:用于比较两个(或更多个)数组的键值,并返回交集.直线电机生产厂家 语法:array_intersect(array1,array2,arra ...

  5. 禁止input输入框输入指定内容

    链接: http://blog.csdn.net/xiaoya_syt/article/details/52746598

  6. (3)狄泰软件学院C++课程学习剖析一

    深度剖析C++第一部分 1.类是一种模型,这种模型可以创建出一个对应的实体.有了类不一定有对应的实体,但是一个实体必定属于某一个类. 2.类用于抽象的描述 一类事物所持有的属性和行为:对象是具体的事物 ...

  7. [CSP-S模拟测试]:reverse(数位DP)

    题目描述 我们定义: $\overline{d_k...d_2d_1}=\sum \limits_{i=1}^kd_i\times {10}^{i-1}=n(d_i\in [0,9]\ and\ d_ ...

  8. CSU 1556 Jerry's trouble

    题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1556 Description Jerry is caught by Tom. He ...

  9. Java连接MySql数据库之JDBC

    1.首先创建一个java Project项目 2.起一个英文的项目名 3.此窗口点击NO 4.此时项目状态如下 5.创建一个文件夹,并将mysql-connector-java-5.1.8-bin.j ...

  10. 622FThe Sum of the k-th Powers

    题目大意 求$\sum_{i=1}^{n} i^k$ 分析 我们发现这是一个$k+1$次多项式 因此我们求出前$k+2$项然后插值即可 由于$x_i = i$ 因此公式里面的乘机可以通过预处理然后循环 ...