dba http://blog.csdn.net/zengxuewen2045/article/details/51524880

关于这个错误:

 
1
2
3
4
Mon Feb 13 10:29:41 2017 - [error][/usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln188] There is no alive server. We can't do failover
Mon Feb 13 10:29:41 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln424] Error happened on checking configurations.  at /usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm line 326
Mon Feb 13 10:29:41 2017 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln523] Error happened on monitoring servers.
Mon Feb 13 10:29:41 2017 - [info] Got exit code 1 (Not master dead).

在之前的部署文档里:

 
1
http://d-prototype.com/archives/6873

我说需要把server_id,改成10,可以走过去。
其实这是很片面的。

今天又遇到了这个问题,并解决了。

关于该问题,比较靠谱的解释是:
MHA默认去连接MySQL的端口是:3306

如果你的主机名解析,或者你写的IP都没问题,防火墙也关闭了,那么,剩下的原因是:
你的MySQL,没有运行在默认端口上。

如果不能修改MySQL的端口为:3306。

那么你可以给MHA,添加PORT描述。

以下是添加端口描述的MHA应用配置文件的样例:

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[server default]
manager_workdir=/work_dir/mha_manager
manager_log=/work_dir/mha_manager/mha_manager.log
 
[server1]
hostname=mha2
candidate_master=1
port=3307
 
[server2]
hostname=mha3
candidate_master=1
port=3307
 
[server3]
hostname=mha4
#candidate_master=1
no_master=1
port=3307

——————————————

=================================================

8.MHA架构中的错误

Tue Apr 28 15:15:36 2015 - [error][/usr/local/share/perl5/MHA/ServerManager.pm, ln193] There is no alive slave. We can't do failover
Tue Apr 28 15:15:36 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln383] Error happend on checking configurations.  at /usr/local/share/perl5/MHA/MasterMonitor.pm line 298
Tue Apr 28 15:15:36 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln478] Error happened on monitoring servers.

解决方法:

(1).删除健康检查文件  rm -rf /var/log/masterha/app1/app1.master_status.health 
(2).在宕机的数据库中重新同步到主服务器 change master to master_host...............

(3).检查复制是否出错 masterha_check_repl --conf=/etc/mysqlmha/conf/app1.cnf

========================================

主从同步已经打好的情况下执行
grant all privileges on *.* to 'root'@'server01' identified by '123qwe!@#';
grant all privileges on *.* to 'root'@'server02' identified by '123qwe!@#';
grant all privileges on *.* to 'root'@'server03' identified by '123qwe!@#';
grant all privileges on *.* to 'root'@'server04' identified by '123qwe!@#';
flush privileges;
[root@server01 lib]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Tue Jul 12 16:08:08 2016 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Jul 12 16:08:08 2016 - [info] Reading application default configurations from /etc/masterha/app1.cnf..
Tue Jul 12 16:08:08 2016 - [info] Reading server configurations from /etc/masterha/app1.cnf..
Tue Jul 12 16:08:08 2016 - [info] MHA::MasterMonitor version 0.53.
Tue Jul 12 16:08:08 2016 - [error][/usr/local/share/perl5/MHA/ServerManager.pm, ln193] There is no alive slave. We can't do failover
Tue Jul 12 16:08:08 2016 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln383] Error happend on checking configurations.  at /usr/local/share/perl5/MHA/MasterMonitor.pm line 298
Tue Jul 12 16:08:08 2016 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln478] Error happened on monitoring servers.
Tue Jul 12 16:08:08 2016 - [info] Got exit code 1 (Not master dead).
配置主主复制架构,并设置其中一台为read_only  (set global read_only=1;)

MHA 报错:There is no alive slave. We can't do failover的更多相关文章

  1. mha 复制检查报错“There is no alive server. We can't do failover”

    安装mha所参考的文章: http://linzhijian.blog.51cto.com/1047212/1906434 http://www.cnblogs.com/xiaoboluo768/p/ ...

  2. 配置MySQL主从复制报错Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work

    配置MySQL主从复制报错 ``` Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave ha ...

  3. mha报错

    用命令检查集群复制状态:masterha_check_repl --conf=/etc/masterha/app1.cnf 报错如下: Tue Jan 12 09:25:51 2016 - [info ...

  4. jenkins slave启动报错:hudson.util.IOException2: Slave JVM has terminated. Exit code=126

    添加mac slave节点报错如下:Expanded the channel window size to 4MB [11/07/14 19:11:54] [SSH] Starting slave p ...

  5. mysql MHA报错 Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 99.

    如果发现如下错误: Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MH ...

  6. MySQL MHA 报错处理

    安装环境:CentOS 6.5 MySQL 5.7.22 MHA 0.56 1.找不到mysql 命令 Sat Mar 23 07:17:50 2019 - [info] Connecting to ...

  7. MySQL主从复制报错及解决方法

    mysql> show slave status \G *************************** 1. row *************************** Slave_ ...

  8. 【MySQL】MySQL同步报错-> received end packet from server, apparent master shutdown: Slave I/O thread: Failed reading log event, reconnecting to retry报错解决和分析

    [root@db-ft-db-48 ~]# tail -f /mysqlLog/beside_index_err.log 140102 20:42:26 [Note] Slave: received ...

  9. jenkins centos slave起不来报错The SSH key presented by the remote host does not match the key saved in the Known Hosts file against this host. Connections to this host will be denied until the two keys mat

    场景:我的centos-204是一台centos的机器,本来用https://www.cnblogs.com/zndxall/p/8297356.html 的centos slave方式搭建ok的,一 ...

随机推荐

  1. Notepad++同一窗口显示左右显示两份文档

    Notepad++同一窗口显示左右显示两份文档   直接打开一份文档,test1.txt 再打开第二份文档,test2.txt,会显示成这样: 两份文档是以标签的形式展示的,有时需要同时查看两份文档, ...

  2. 微软Power BI 每月功能更新系列——11月Power BI 新功能学习

    Power BI Desktop11月产品功能摘要 本月Power BI Desktop 有一个大规模的更新.现在,通常可以使用复合模型在一个模型中将直接查询和导入源组合在一起.UserVoice上的 ...

  3. 第二十六课 典型问题分析(Bugfix)

    问题1: glibc中的strdup实现如下: 没有对参数s进行空指针判断. 我们的Exception.cpp中应做改进: 在第12行进行判断空指针操作. 问题2: t1在析构时会抛出异常,我们在re ...

  4. simhash

    1,SimHash https://yanyiwu.com/work/2014/01/30/simhash-shi-xian-xiang-jie.html 64位Hash为什么海明距离选3? http ...

  5. php在foreach中使用引用赋值&可能遇到的问题(转)

    楼主在写项目的时候,由于初涉PHP的赋值引用操作,觉得这个功能非常强大,用时一时爽,没有深入了解过其中的原理,导致了一些当时觉得不可思议的BUG,废话不都说,我举个例子详细的描述一下这个问题. 代码: ...

  6. Java 构造器Constructor 继承

    Java默认构造方法 构造方法作用:初始化所定义的类的对象和属性. 构造方法没有返回类型. 2 继承中的构造器 子类是不继承父类的构造器(构造方法或者构造函数)的,它只是调用(隐式或显式). 如果父类 ...

  7. 模拟主库创建数据文件,dg备库空间不足时问题处理

    本篇文档测试目的: 模拟实际环境中,主库对表空间添加数据文件,备库空间不足,最终导致MRP进程自动断开,处理方式. 1.问题环境模拟 1)正常情况下的dg 主库创建数据文件,备库接受日志,自动创建表空 ...

  8. jQuery的效果(动画)

    jquery的效果(动画) show 概念:显示隐藏的匹配元素 语法:show(speed,callback) 参数:speed:三种预定速度之一的字符串('slow','normal','fast' ...

  9. input标签(按钮)

    按钮: <input type="button" name="..." value="..." /> <input typ ...

  10. Gym101482 NWERC 2014(队内训练第4场)

    -----------------------前面的两场感觉质量不高,就没写题解----------------------------- A .Around the Track pro:给定内多边形 ...