如果发现如下错误:

  1. Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 99.
  2. mysqlbinlog version not found!
  1. Testing mysql connection and privileges..sh: mysql: command not found
  2. mysql command failed with rc 127:0!

可以通过以下方法解决(在所有节点上执行):

  1. 192.168.2.128 [root ~]$ ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
  2. 192.168.2.128 [root ~]$ ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
  3.  
  4. 192.168.2.129 [root ~]$ ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
  5. 192.168.2.129 [root ~]$ ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
  6.  
  7. 192.168.2.130 [root ~]$ ln -s /usr/local/mysql/bin/mysqlbinlog /usr/local/bin/mysqlbinlog
  8. 192.168.2.130 [root ~]$ ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

再进行检查

  1. 192.168.2.131 [root ~]$ masterha_check_repl --conf=/etc/masterha/app1.cnf
  2. Sun Jan 18 13:19:41 2015 - [info] Checking replication health on 192.168.2.129..
  3. Sun Jan 18 13:19:41 2015 - [info] ok.
  4. Sun Jan 18 13:19:41 2015 - [info] Checking replication health on 192.168.2.130..
  5. Sun Jan 18 13:19:41 2015 - [info] ok.
  6. Sun Jan 18 13:19:41 2015 - [info] Checking master_ip_failover_script status:
  7. Sun Jan 18 13:19:41 2015 - [info] /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.2.128 --orig_master_ip=192.168.2.128 --orig_master_port=3306
  8. Bareword "FIXME_xxx" not allowed while "strict subs" in use at /usr/local/bin/master_ip_failover line 88.
  9. Execution of /usr/local/bin/master_ip_failover aborted due to compilation errors.
  10. Sun Jan 18 13:19:41 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln214] Failed to get master_ip_failover_script status with return code 255:0.
  11. Sun Jan 18 13:19:41 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln383] Error happend on checking configurations. at /usr/local/bin/masterha_check_repl line 48
  12. Sun Jan 18 13:19:41 2015 - [error][/usr/local/share/perl5/MHA/MasterMonitor.pm, ln478] Error happened on monitoring servers.
  13. Sun Jan 18 13:19:41 2015 - [info] Got exit code 1 (Not master dead).
  14.  
  15. MySQL Replication Health is NOT OK!
  16. 192.168.2.131 [root ~]$

还是报错,纠结N久,才发现原因是:原来Failover两种方式:一种是虚拟IP地址,一种是全局配置文件。MHA并没有限定使用哪一种方式,而是让用户自己选择,虚拟IP地址的方式会牵扯到其它的软件,比如keepalive软件,而且还要修改脚本master_ip_failover。

所以先暂时注释master_ip_failover_script= /usr/local/bin/master_ip_failover这个选项。后面引入keepalived后和修改该脚本以后再开启该选项

  1. 192.168.2.131 [root ~]$ grep master_ip_failover /etc/masterha/app1.cnf
  2. #master_ip_failover_script= /usr/local/bin/master_ip_failover

再次进行状态查看:

  1. 192.168.2.131 [root ~]$ masterha_check_repl --conf=/etc/masterha/app1.cnf
  2. Sun Jan 18 13:23:57 2015 - [info] Slaves settings check done.
  3. Sun Jan 18 13:23:57 2015 - [info]
  4. 192.168.2.128 (current master)
  5. +--192.168.2.129
  6. +--192.168.2.130
  7.  
  8. Sun Jan 18 13:23:57 2015 - [info] Checking replication health on 192.168.2.129..
  9. Sun Jan 18 13:23:57 2015 - [info] ok.
  10. Sun Jan 18 13:23:57 2015 - [info] Checking replication health on 192.168.2.130..
  11. Sun Jan 18 13:23:57 2015 - [info] ok.
  12. Sun Jan 18 13:23:57 2015 - [warning] master_ip_failover_script is not defined.
  13. Sun Jan 18 13:23:57 2015 - [warning] shutdown_script is not defined.
  14. Sun Jan 18 13:23:57 2015 - [info] Got exit code 0 (Not master dead).
  15.  
  16. MySQL Replication Health is OK.
  17. 192.168.2.131 [root ~]$

已经没有明显报错,只有两个警告而已,复制也显示正常了,哈哈,没报错了,先乐一会^0^

mysql MHA报错 Can't exec "mysqlbinlog": No such file or directory at /usr/local/share/perl5/MHA/BinlogManager.pm line 99.的更多相关文章

  1. Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.

    今天执行:autoreconf -fvi的时候出现如下错误: autoreconf: Entering directory `.' autoreconf: configure.in: not usin ...

  2. TP连接数据库报错:SQLSTATE[HY000] [2002] No such file or directory

     连接数据库报错:“SQLSTATE[HY000] [2002] No such file or directory”. 出现这个问题的原因是PDO无法找到mysql.sock或者mysqld.soc ...

  3. cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,

    1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://reg ...

  4. Windows下使用ssh-add报错 Error connecting to agent: No such file or directory

    Windows下使用ssh-add报错 Error connecting to agent: No such file or directory 环境信息 操作系统:windows 10 终端:Win ...

  5. npm安装socket.io时报错的解决方法(npm WARN enoent ENOENT: no such file or directory, open '/usr/local/nodejs/bin/package.json')

    执行 npm install socket.io安装时报错: [root@WEB node_modules]# npm install socket.ionpm WARN enoent ENOENT: ...

  6. mysql启动报错 The server quit without updating PID file

    [root@uz6542 data]# /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updatin ...

  7. 解决mac os下mcss命令报错:env: node\r: No such file or directory

    标题无“转载”即原创文章,版权所有.转载请注明来源:http://besteam.im/blogs/article/31/. 我一直对字符界面有抵触感,即使会用vim,我的linux脚本(python ...

  8. 编译APR包报错 rm: cannot remove `libtoolT': No such file or directory

    centos 6  编译APR包报错 在当前apr 目录 : #Vi configure +31880  ,注释掉此行 再次编译即可.

  9. 编译 redis 报错 error: jemalloc/jemalloc.h: No such file or directory

    gcc编译redis时报错: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory zmalloc.h:55:2 ...

随机推荐

  1. 论文笔记《Fully Convolutional Networks for Semantic Segmentation》

    一.Abstract 提出了一种end-to-end的做semantic segmentation的方法,也就是FCN,是我个人觉得非常厉害的一个方法. 二.亮点 1.提出了全卷积网络的概念,将Ale ...

  2. 【CCF】除法 树状数组

    [AC] #include<iostream> #include<math.h> #include<cstring> using namespace std; ty ...

  3. [暑假集训--数论]poj3518 Prime Gap

    The sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not eq ...

  4. nodeJS学习(7)--- WS开发 NodeJS 项目-节2 <安装&设置&启动 mongodb 数据库++遇到的问题>

    本文系统 win7 参考:http://lib.csdn.net/article/mongodb/58097  http://www.cnblogs.com/lzrabbit/p/3682510.ht ...

  5. hdu 1423 最长上升递增子序列

    #include <iostream> #include <cstdio> #include <cstring> using namespace std; ; in ...

  6. alloc_chrdev_region申请一个动态主设备号,并申请一系列次设备号

    ret = alloc_chrdev_region(&ndev, 0, 1, "chr_dev"); //分配设备号 alloc_chrdev_region申请一个动态主设 ...

  7. hdu 2363(枚举+最短路好题)

    Cycling Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Sub ...

  8. GIT 的常规操作

    GIT 的常规操作 常规操作也是我自己平时常用的几个命令, 学自于 pro git 这本书中 git 配置文件 git的配置文件位置 针对所有用户:/etc/gitconfig 针对当前用户: -/. ...

  9. java获取整数的各位数值

    第一种是取模运算 int qian =input/1000; //千位除以1000 int bai = input/100%10;//百位除以100%10 int shi = input%100/10 ...

  10. Codeforces 919 D Substring

    题目描述 You are given a graph with nn nodes and mm directed edges. One lowercase letter is assigned to ...