博客
关于我
mha常见的一些报错
阅读量:196 次
发布时间:2019-02-28

本文共 1244 字,大约阅读时间需要 4 分钟。

MHA常见错误及解决方法

错误1:依赖包安装失败

错误描述:

安装 mha4mysql-manager 时,遇到以下错误:

Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch          Requires: perl(Log::Dispatch)Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch          Requires: perl(Log::Dispatch::File)Error: Package: mha4mysql-manager-0.58-0.el7.centos.noarch          Requires: perl(Log::Dispatch::Screen)

解决方法:

  • 安装EPEL-release:确保系统中的依赖包已正确安装。
    rpm -Uvh epel-release*rpm
  • 安装依赖的perl模块
    yum -y install perl-Log-Dispatch
  • 注意事项:

    安装 mha4mysql-managermha4mysql-node 时,确保依赖包已正确处理。


    错误2:健康检查提示无主库

    错误描述:

    运行 masterha_check_ssh 时出现以下警告:

    Global configuration file /etc/masterha_default.cnf not found. Skipping.

    解决方法:

    确保 app1.cnf 文件中没有空格参数。检查文件内容,避免配置文件格式错误。


    错误3:SSH连接权限问题

    错误描述:

    无法通过SSH连接到目标主库,出现以下错误:

    Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

    解决方法:

  • 检查 app1.cnf 文件,确保没有空格参数。
  • 注释掉管理节点的配置:
    #vim /etc/mha4mysql/app1.cnf#将manager配置注释掉

  • 错误4:MySQL复制健康检查失败

    错误描述:

    masterha_check_repl 检查失败,提示无活跃副库:

    There is no alive slave. We can't do failover

    解决方法:

  • 删除健康检查日志:
    rm -rf /var/log/masterha/app1/app1.master_status.health
  • 在主库上重新同步数据库:
    change master to master_host=...
  • 检查复制状态:
    masterha_check_repl --conf=/etc/mysqlmha/conf/app1.cnf

  • 总结:

    以上错误均与MHA配置或依赖包安装问题有关。通过检查配置文件、依赖包安装以及权限设置,可以有效解决问题。

    转载地址:http://sitn.baihongyu.com/

    你可能感兴趣的文章
    POJ 3041 Asteroids(二分匹配模板题)
    查看>>
    Qt笔记——标准文件对话框QFileDialog
    查看>>
    poj 3083 Children of the Candy Corn
    查看>>
    POJ 3083 Children of the Candy Corn 解题报告
    查看>>
    POJ 3253 Fence Repair C++ STL multiset 可解 (同51nod 1117 聪明的木匠)
    查看>>
    Qt笔记——控件总结
    查看>>
    poj 3262 Protecting the Flowers 贪心
    查看>>
    poj 3264(简单线段树)
    查看>>
    Qt笔记——布局管理三件套分割窗口、停靠窗口和堆栈窗口
    查看>>
    poj 3277 线段树
    查看>>
    POJ 3349 Snowflake Snow Snowflakes
    查看>>
    POJ 3411 DFS
    查看>>
    poj 3422 Kaka's Matrix Travels (费用流 + 拆点)
    查看>>
    Qt笔记——官方文档全局定义(二)Functions函数
    查看>>
    POJ 3468 A Simple Problem with Integers
    查看>>
    poj 3468 A Simple Problem with Integers 降维线段树
    查看>>
    poj 3468 A Simple Problem with Integers(线段树 插线问线)
    查看>>
    poj 3485 区间选点
    查看>>
    poj 3518 Prime Gap
    查看>>
    poj 3539 Elevator——同余类bfs
    查看>>