时间:2021-07-01 10:21:17 帮助过:12人阅读
Node工具包(这些工具通常由MHA Manager的脚本触发,无需人为操作)主要包括以下几个工具:
- <span style="color: #000000;">save_binary_logs 保存和复制master的二进制日志
- apply_diff_relay_logs 识别差异的中继日志事件并将其差异的事件应用于其他的slave
- filter_mysqlbinlog 去除不必要的ROLLBACK事件(MHA已不再使用这个工具)
- purge_relay_logs 清除中继日志(不会阻塞SQL线程)</span>
基本工作流程大致如下:
(1) Manager定期监控Master,监控时间间隔由参数ping_interval决定,缺省为3秒钟一次;可利用其自身的监控功能,也可调用第三方软件来监控;MHA自身提供了两种监控方式:SELECT(执行SELECT 1)和CONNECT(创建连接/断开连接),
主要由ping_type参数决定,默认是select方式。
(2) 当监测到Master故障时,调用SSH脚本对所有Node执行一次检查,包括如下几个方面:
――MySQL实例是否可以连接;
――Master服务器是否可以SSH连通;
――检查SQL Thread的状态;
――检查哪些Server死掉了,哪些Server是活动的,以及活动的Slave实例;
――检查Slave实例的配置及复制过滤规则;
――最后退出监控脚本并返回代表特殊意义代码。
(3) 开始Master故障切换,包括如下几个子阶段:
――Phase 1: Configuration Check Phase
在这个阶段,若某个Slave实例的SQL Thread停止了,则会自动启动它;并再次确认活动的Servers及Slaves。
――Phase 2: Dead Master Shutdown Phase
在这个阶段,首先调用master_ip_failover_script,若HA是基于VIP实现的,则关闭VIP,若是基于目录数据库实现的,则修改映射记录。然后调用shutdown_script脚本强制关闭主机,以避免服务重启时,发生脑裂。
――Phase 3: Master Recovery Phase
又包括如下3个子阶段:
Phase 3.1: Getting Latest Slaves Phase
检查各个Slave,获取最近的和最旧的binary log file和position,并检查各个Slave成为Master的优先级,依赖于candidate_master、no_master、 [server_xxx]顺序、binary log差异量等因素。
Phase 3.2: Saving Dead Master‘s Binlog Phase
若dead master所在服务器依然可以通过SSH连通,则提取dead master的binary log,提取日志的起点就是上一步获取的最新的binary log file和position,直到最后一条事件日志,并在dead master本地的工作目录(由参数remote_workdir决定)中
创建文件保存这些提取到的日志,然后将该文件拷贝到Manager服务器的工作 目录下(由参数manager_workdir决定)。若dead master系统就无法连接,也就不存在差异的binary log了。MHA还要对各个Slave节点进行健康检查,主要是SSH连通性。
Phase 3.3: Determining New Master Phase
接下来调用apply_diff_relay_logs命令恢复Slave的差异日志,这个差异日志指的是各个Slave之间的relay log。恢复完成后,所有的Slave数据是一致的,此时就可以根据优先级选择New Master了。
Phase 3.4: New Master Diff Log Generation Phase
这里是生成dead master和new master之间的差异日志,即将Phase 3.2保存的binary log拷贝到New Master的工作目录中(remote_workdir)。
Phase 3.5: Master Log Apply Phase
将上一步拷贝的差异日志恢复到New Master上,若发生错误,也可手动恢复。然后获取New Master的binlog name和position,以便其它Slave从这个新的binlog name和position开始复制。最后会开启New Master的写权限,即将read_only参数设置为0。
――Phase 4: Slaves Recovery Phase
Phase 4.1: Starting Parallel Slave Diff Log Generation Phase
生成Slave与New Slave之间的差异日志,并将该日志拷贝到各Slave的工作目录下,这部分日志dead master和new master之间差异的那部分日志,因为各个Slave在Phase 3.3阶段已经同步了。
Phase 4.2: Starting Parallel Slave Log Apply Phase
在各个Slave上应用这部分差异日志,然后通过CHANGE MASTER TO命令将这些Slave指向新的New Master,最后开始复制(start slave)。
――Phase 5: New master cleanup phase
清理New Master其实就是重置slave info,即取消原来的Slave信息。至此整个Master故障切换过程完成。
######################################################################################################################################
二、【实验部分】
- <span style="font-size: 14px;"><strong>1、【环境说明】:默认三台机器上都已安装mysql5.6,且主从复制已经配置完成。<br></strong></span><br>主库:<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129(读写)</span><span style="color: #000000;">
- 从1: </span><span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span><span style="color: #000000;">(指定的接管主库)(只读)
- 从2: </span><span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132<span style="color: #000000;">(只读)</span></span><span style="color: #000000;">
- vip: </span><span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.100</span>
这里需要设置两个从库为只读库,不建议将它写入配置文件,因为有个从库随时会切换为主库。如下:
- set global read_only=<span style="color: #800080;">1</span>
2、配置三台机器之间的信任机制(省)
目的:机器之间能够无需输入密码进行访问
3、安装mha软件
- #安装可能需要的依赖包<br>[root@node1 software]# <span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-DBD-<span style="color: #000000;">MySQL
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-Config-<span style="color: #000000;">Tiny
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-Parallel-ForkManager*<span style="color: #000000;">.rpm
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-Mail-Sender*<span style="color: #000000;">.rpm
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-Mail-Sendmail*<span style="color: #000000;">.rpm
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> <span style="color: #0000ff;">perl</span>-Log-Dispatch*<span style="color: #000000;">.rpm <br>#安装mha,这里用rpm包安装,默认在/usr/bin
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> mha4mysql-node-<span style="color: #800080;">0.56</span>-<span style="color: #800080;">0</span><span style="color: #000000;">.el6.noarch.rpm
- [root@node1 software]# </span><span style="color: #0000ff;">yum</span> <span style="color: #0000ff;">install</span> mha4mysql-manager-<span style="color: #800080;">0.56</span>-<span style="color: #800080;">0</span>.el6.noarch.rpm
4、配置主库服务器的vip并测试
这里通过脚本手动创建vip,如下:
- [root@node1 scripts]# <span style="color: #0000ff;">cat</span> init_vip.<span style="color: #0000ff;">sh</span><span style="color: #000000;">
- vip</span>=<span style="color: #800000;">"</span><span style="color: #800000;">192.168.1.100/32</span><span style="color: #800000;">"</span>
- /sbin/ip addr add $vip dev eth0
【测试】到任意从库ping 192.168.245.100 --看是否连上vip
mysql -h 192.168.223.100 -udarren -pdarren --是否连上vip数据库
如果都能够连接上,表示vip设置成功了。
5、配置mha及启动
(1)创建mha监控用户(在主库执行,这样每个服务器都有这个用户了)
- mysql> grant all privileges on *.* to <span style="color: #800000;">‘</span><span style="color: #800000;">root</span><span style="color: #800000;">‘</span>@<span style="color: #800000;">‘</span><span style="color: #800000;">%</span><span style="color: #800000;">‘</span> identified by <span style="color: #800000;">‘</span><span style="color: #800000;">123456</span><span style="color: #800000;">‘</span><span style="color: #000000;">;
- Query OK, </span><span style="color: #800080;">0</span> rows affected (<span style="color: #800080;">0.00</span><span style="color: #000000;"> sec)
- mysql</span>><span style="color: #000000;"> flush privileges;
- Query OK, </span><span style="color: #800080;">0</span> rows affected (<span style="color: #800080;">0.01</span> sec)
(2)修改mha配置文件
purge_relay_logs的主要功能:
a、为relay日志创建硬链接(最小化批量删除大文件导致的性能问题)
b、SET GLOBAL relay_log_purge=1; FLUSH LOGS; SET GLOBAL relay_log_purge=0;
c、删除relay log(rm –f /path/to/archive_dir/*)
- <strong><span style="color: #000000;">purge_relay_logs的用法及相关参数
- </span><span style="color: #800080;">1</span> purge_relay_logs --</strong><span style="color: #000000;"><strong>help</strong>
- Usage:
- purge_relay_logs </span>--user=root --password=rootpass --host=<span style="color: #800080;">127.0</span>.<span style="color: #800080;">0.1</span>
- <strong><span style="color: #800080;">2</span><span style="color: #000000;"> 参数描述
- </span></strong>--<span style="color: #000000;">user 用户名,缺省为root
- </span>--<span style="color: #000000;">password 密码
- </span>--<span style="color: #000000;">port 端口号
- </span>--host 主机名,缺省为127.<span style="color: #800080;">0.0</span>.<span style="color: #800080;">1</span>
- --workdir 指定创建relay log的硬链接的位置,默认是/var/<span style="color: #000000;">tmp,成功执行脚本后,硬链接的中继日志文件被删除,由于系统不同分区创建硬链接文件会失败,故需要执行硬链接具体位置,建议指定为relay log相同的分区
- </span>--disable_relay_log_purge 默认情况下,如果参数relay_log_purge=<span style="color: #800080;">1</span>,脚本不做任何处理,自动退出.设定该参数,脚本会将relay_log_purge设置为0,当清理relay log之后,最后将参数设置为OFF(<span style="color: #800080;">0</span><span style="color: #000000;">)<br>
- </span><strong><span style="color: #800080;">3</span></strong><span style="color: #000000;"><strong> 定制清理relay log cronjob</strong>
- pureg_relay_logs脚本在不阻塞SQL线程的情况下自动清理relay log。对于不断产生的relay log直接将该脚本部署到crontab以实现按天或按小时定期清理。
- $ crontab </span>-<span style="color: #000000;">l
- # purge relay logs at 5am
- </span><span style="color: #800080;">0</span> <span style="color: #800080;">5</span> * * * app /usr/bin/purge_relay_logs --user=root --password=PASSWORD --disable_relay_log_purge >> /var/log/masterha/purge_relay_logs.log <span style="color: #800080;">2</span>>&<span style="color: #800080;">1</span>
- (product)root@<span style="color: #800080;">127.0</span>.<span style="color: #800080;">0.1</span> [(none)]> set global relay_log_purge=<span style="color: #800080;">0</span><span style="color: #000000;">;
- Query OK, </span><span style="color: #800080;">0</span> rows affected (<span style="color: #800080;">0.00</span> sec)
- <span style="color: #000000;">#清除脚本
- #</span>!/bin/<span style="color: #000000;">bash
- user</span>=<span style="color: #000000;">root
- </span><span style="color: #0000ff;">passwd</span>=<span style="color: #000000;">root
- port</span>=<span style="color: #800080;">3306</span><span style="color: #000000;">
- log_dir</span>=<span style="color: #800000;">‘</span><span style="color: #800000;">/data/masterha/log</span><span style="color: #800000;">‘</span><span style="color: #000000;">
- work_dir</span>=<span style="color: #800000;">‘</span><span style="color: #800000;">/data</span><span style="color: #800000;">‘</span><span style="color: #000000;">
- purge</span>=<span style="color: #800000;">‘</span><span style="color: #800000;">/usr/bin/purge_relay_logs</span><span style="color: #800000;">‘</span>
- <span style="color: #0000ff;">if</span> [ ! -<span style="color: #000000;">d $log_dir ]
- </span><span style="color: #0000ff;">then</span>
- <span style="color: #0000ff;">mkdir</span> $log_dir -<span style="color: #000000;">p
- </span><span style="color: #0000ff;">fi</span><span style="color: #000000;">
- $purge </span>--user=$user --password=$<span style="color: #0000ff;">passwd</span> --disable_relay_log_purge --port=$port --workdir=$work_dir >> $log_dir/purge_relay_logs.log <span style="color: #800080;">2</span>>&<span style="color: #800080;">1</span><span style="color: #000000;">
- #定时任务
- crontab </span>-<span style="color: #000000;">e
- #每天早上5点10分执行
- </span><span style="color: #800080;">10</span> <span style="color: #800080;">5</span> * * * <span style="color: #0000ff;">sh</span> /data/scripts/purge_relay_log.<span style="color: #0000ff;">sh</span>
到manager节点的/etc下面新建masterha目录,并将mha需要的配置初始化文件拷贝到该目录下:
- [root@node3 ~]# cd /<span style="color: #000000;">etc
- [root@node3 etc]# <span style="color: #0000ff;">mkdir masterha<br>#创建以下mha日志目录,没有则报错<br></span>[root@node3 etc]#</span>mkdir -p /var/log/masterha/app1
- <span style="color: #000000;">[root@node3 mastermha]# ll
- total <span style="color: #800080;">32
- -rw-r--r--. <span style="color: #800080;">1 root root <span style="color: #800080;">503 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26<span style="color: #000000;"> app1.conf
- -rwxr-xr-x. <span style="color: #800080;">1 root root <span style="color: #800080;">55 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26 drop_vip.<span style="color: #0000ff;">sh
- -rwxr-xr-x. <span style="color: #800080;">1 root root <span style="color: #800080;">55 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26 init_vip.<span style="color: #0000ff;">sh
- -rw-r--r--. <span style="color: #800080;">1 root root <span style="color: #800080;">357 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26<span style="color: #000000;"> masterha_default.conf
- -rwxr-xr-x. <span style="color: #800080;">1 root root <span style="color: #800080;">3888 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26<span style="color: #000000;"> master_ip_failover
- -rwxr-xr-x. <span style="color: #800080;">1 root root <span style="color: #800080;">10298 Nov <span style="color: #800080;">9 <span style="color: #800080;">01:<span style="color: #800080;">26 master_ip_online_change</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
然后修改vip的值:在masterha目录下执行grep "vip" *,将会列出所有文件中vip变量,然后一一修改为192.168.245.100。
修改app1.conf文件:
- <span style="color: #000000;">#mha manager工作目录
- manager_workdir </span>= /var/log/masterha/<span style="color: #000000;">app1
- manager_log </span>= /var/log/masterha/app1/<span style="color: #000000;">app1.log
- remote_workdir </span>= /var/log/masterha/<span style="color: #000000;">app1
- user</span>=<span style="color: #000000;">root
- password</span>=<span style="color: #000000;">root
- ssh_user</span>=<span style="color: #000000;">root
- repl_user</span>=<span style="color: #000000;">repl
- repl_password</span>=<span style="color: #000000;">repl4slave
- ping_interval</span>=<span style="color: #800080;">1</span><span style="color: #000000;">
- shutdown_script</span>=<span style="color: #800000;">""</span><span style="color: #000000;">
- master_ip_online_change_script</span>=<span style="color: #800000;">""</span><span style="color: #000000;">
- report_script</span>=<span style="color: #800000;">""</span><span style="color: #000000;">
- [server1]
- </span><span style="color: #0000ff;">hostname</span>=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span><span style="color: #000000;">
- master_binlog_dir </span>= /data/mysql/mysql_3306/<span style="color: #000000;">logs
- candidate_master</span>=<span style="color: #800080;">1</span><span style="color: #000000;">
- check_repl_delay</span>=<span style="color: #800080;">0</span><span style="color: #000000;">
- [server2]
- </span><span style="color: #0000ff;">hostname</span>=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span><span style="color: #000000;">
- master_binlog_dir</span>=/data/mysql/mysql_3306/<span style="color: #000000;">logs
- candidate_master</span>=<span style="color: #800080;">1</span><span style="color: #000000;">
- check_repl_delay</span>=<span style="color: #800080;">0</span><span style="color: #000000;">
- [server3]
- </span><span style="color: #0000ff;">hostname</span>=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span><span style="color: #000000;">
- port</span>=<span style="color: #800080;">3306</span>
- <span style="color: #000000;">#检查MHA Manger到所有MHA Node的SSH连接状态:
- [root@node3 masterha]# </span>/usr/bin/masterha_check_ssh --conf=/etc/masterha/<span style="color: #000000;">app1.conf
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">21</span> <span style="color: #800080;">2015</span> - [warning] Global configuration <span style="color: #0000ff;">file</span> /etc/<span style="color: #000000;">masterha_default.cnf not found. Skipping.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">21</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Reading application default configuration from /etc/masterha/<span style="color: #000000;">app1.conf..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">21</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Reading server configuration from /etc/masterha/<span style="color: #000000;">app1.conf..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">21</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Starting SSH connection tests..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">24</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug]
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">21</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">23</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">23</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">24</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">25</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug]
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">22</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">23</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">23</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">25</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">25</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug]
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">22</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">24</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">24</span> <span style="color: #800080;">2015</span> - [debug] Connecting via SSH from root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">22</span>) to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">25</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [debug] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">24</span>:<span style="color: #800080;">25</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] All SSH connection tests passed successfully.
View Code
- <span style="color: #000000;">#检查主从复制环境
- [root@node3 masterha]# </span>/usr/bin/masterha_check_repl --conf=/etc/masterha/<span style="color: #000000;">app1.conf
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">08</span> <span style="color: #800080;">2015</span> - [warning] Global configuration <span style="color: #0000ff;">file</span> /etc/<span style="color: #000000;">masterha_default.cnf not found. Skipping.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">08</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Reading application default configuration from /etc/masterha/<span style="color: #000000;">app1.conf..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">08</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Reading server configuration from /etc/masterha/<span style="color: #000000;">app1.conf..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">08</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] MHA::MasterMonitor version <span style="color: #800080;">0.56</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] GTID failover mode = <span style="color: #800080;">0</span><span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Dead Servers:
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Alive Servers:
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Alive Slaves:
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">3306</span>) Version=<span style="color: #800080;">5.6</span>.<span style="color: #800080;">23</span>-log (oldest major version between slaves) log-<span style="color: #000000;">bin:enabled
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Replicating from <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Primary candidate <span style="color: #0000ff;">for</span><span style="color: #000000;"> the new Master (candidate_master is set)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">3306</span>) Version=<span style="color: #800080;">5.6</span>.<span style="color: #800080;">21</span>-log (oldest major version between slaves) log-<span style="color: #000000;">bin:enabled
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Replicating from <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Current Alive Master: <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Checking slave configurations..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] read_only=<span style="color: #800080;">1</span> is not set on slave <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">).
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] read_only=<span style="color: #800080;">1</span> is not set on slave <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">).
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Checking replication filtering settings..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] binlog_do_db= , binlog_ignore_db=<span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Replication filtering check ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] GTID (with auto-<span style="color: #000000;">pos) is not supported
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">09</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Starting SSH connection tests..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">12</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] All SSH connection tests passed successfully.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">12</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Checking MHA Node version..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">13</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Version check ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">13</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Checking SSH publickey authentication settings on the current master..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">13</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] HealthCheck: SSH to <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span><span style="color: #000000;"> is reachable.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">14</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Master MHA Node version is <span style="color: #800080;">0.56</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">14</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Checking recovery script configurations on <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">14</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Executing command: save_binary_logs --command=test --start_pos=<span style="color: #800080;">4</span> --binlog_dir=/data/mysql/mysql_3306/logs --output_file=/var/log/masterha/app1/save_binary_logs_test --manager_version=<span style="color: #800080;">0.56</span> --start_file=mysql-bin.<span style="color: #800080;">000023</span><span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">14</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Connecting to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Creating </span>/var/log/masterha/app1 <span style="color: #0000ff;">if</span><span style="color: #000000;"> not exists.. ok.
- Checking output directory is accessible or not..
- ok.
- Binlog found at </span>/data/mysql/mysql_3306/logs, up to mysql-bin.<span style="color: #800080;">000023</span><span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Binlog setting check <span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Executing command : apply_diff_relay_logs --command=test --slave_user=<span style="color: #800000;">‘</span><span style="color: #800000;">root</span><span style="color: #800000;">‘</span> --slave_host=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span> --slave_ip=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span> --slave_port=<span style="color: #800080;">3306</span> --workdir=/var/log/masterha/app1 --target_version=<span style="color: #800080;">5.6</span>.<span style="color: #800080;">23</span>-log --manager_version=<span style="color: #800080;">0.56</span> --relay_log_info=/data/mysql/mysql_3306/data/relay-log.<span style="color: #0000ff;">info</span> --relay_dir=/data/mysql/mysql_3306/data/ --slave_pass=<span style="color: #000000;">xxx
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Connecting to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Checking slave recovery environment settings..
- Opening </span>/data/mysql/mysql_3306/data/relay-log.<span style="color: #0000ff;">info</span><span style="color: #000000;"> ... ok.
- Relay log found at </span>/data/mysql/mysql_3306/data, up to relay-bin.<span style="color: #800080;">000009</span><span style="color: #000000;">
- Temporary relay log </span><span style="color: #0000ff;">file</span> is /data/mysql/mysql_3306/data/relay-bin.<span style="color: #800080;">000009</span><span style="color: #000000;">
- Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
- </span><span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Testing mysqlbinlog output.. </span><span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Cleaning up test </span><span style="color: #0000ff;">file</span>(s).. <span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Executing command : apply_diff_relay_logs --command=test --slave_user=<span style="color: #800000;">‘</span><span style="color: #800000;">root</span><span style="color: #800000;">‘</span> --slave_host=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span> --slave_ip=<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span> --slave_port=<span style="color: #800080;">3306</span> --workdir=/var/log/masterha/app1 --target_version=<span style="color: #800080;">5.6</span>.<span style="color: #800080;">21</span>-log --manager_version=<span style="color: #800080;">0.56</span> --relay_log_info=/data/mysql/data/relay-log.<span style="color: #0000ff;">info</span> --relay_dir=/data/mysql/data/ --slave_pass=<span style="color: #000000;">xxx
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">15</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Connecting to root@<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">22</span><span style="color: #000000;">)..
- Checking slave recovery environment settings..
- Opening </span>/data/mysql/data/relay-log.<span style="color: #0000ff;">info</span><span style="color: #000000;"> ... ok.
- Relay log found at </span>/data/mysql/data, up to node3-relay-bin.<span style="color: #800080;">000007</span><span style="color: #000000;">
- Temporary relay log </span><span style="color: #0000ff;">file</span> is /data/mysql/data/node3-relay-bin.<span style="color: #800080;">000007</span><span style="color: #000000;">
- Testing mysql connection and privileges..Warning: Using a password on the command line interface can be insecure.
- </span><span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Testing mysqlbinlog output.. </span><span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Cleaning up test </span><span style="color: #0000ff;">file</span>(s).. <span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Slaves settings check <span style="color: #0000ff;">done</span><span style="color: #000000;">.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">]
- </span><span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.129</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">) (current master)
- </span>+--<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- </span>+--<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>(<span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span>:<span style="color: #800080;">3306</span><span style="color: #000000;">)
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Checking replication health on <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.131</span><span style="color: #000000;">..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Checking replication health on <span style="color: #800080;">192.168</span>.<span style="color: #800080;">245.132</span><span style="color: #000000;">..
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span><span style="color: #000000;">] ok.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [warning] master_ip_failover_script is not defined.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> -<span style="color: #000000;"> [warning] shutdown_script is not defined.
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">37</span>:<span style="color: #800080;">16</span> <span style="color: #800080;">2015</span> - [<span style="color: #0000ff;">info</span>] Got exit code <span style="color: #800080;">0</span><span style="color: #000000;"> (Not master dead).
- MySQL Replication Health is OK.</span>
如果遇到这个报错:
- Can<span style="color: #800000;">‘</span><span style="color: #800000;">t exec "mysqlbinlog": No such file or directory at /usr/share/perl5/vendor_perl/MHA/BinlogManager.pm line 106.</span>
- mysqlbinlog version command failed with rc <span style="color: #800080;">1</span>:<span style="color: #800080;">0</span><span style="color: #000000;">, please verify PATH, LD_LIBRARY_PATH, and client options
- at </span>/usr/bin/apply_diff_relay_logs line <span style="color: #800080;">493</span><span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">32</span>:<span style="color: #800080;">36</span> <span style="color: #800080;">2015</span> - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln205] Slaves settings check failed!<span style="color: #000000;">
- Mon Nov </span><span style="color: #800080;">16</span> <span style="color: #800080;">01</span>:<span style="color: #800080;">32</span>:<span style="color: #800080;">36</span> <span style="color: #800080;">2015</span> - [e