博客
关于我
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-manager 和 mha4mysql-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/

    你可能感兴趣的文章
    Python:deepcopy(list) vs new_list = old_list[:]
    查看>>
    Python:Google API - 从消息中获取 mimeTypes
    查看>>
    Python:Google API - 从消息中获取 mimeTypes
    查看>>
    Python:subprocess.call,stdout to file,stderr to file,在屏幕上实时显示stderr
    查看>>
    Python:TypeError:无法连接“str“和“int“对象
    查看>>
    Python:XPath 在 ElementTree 中不可用
    查看>>
    Python:从 FTP 服务器下载文件
    查看>>
    python:从列表中创建元组列表
    查看>>
    Python:从嵌套列表中删除重复项
    查看>>
    Python:从间隔映射到值
    查看>>
    Python:使用 shell=False 的子进程调用不起作用
    查看>>
    Python:修改 PATH 环境变量的平台无关方式
    查看>>
    Python:假与 0
    查看>>
    Python:函数使用
    查看>>
    Python:函数进阶
    查看>>
    Python:在整数的二进制表示中查找最长的二进制间隙
    查看>>
    Python:如何从二进制转换为 base 64 并返回?
    查看>>
    Python:如何以非阻塞方式读取子进程的标准输出
    查看>>
    Python:如何使用 plotly 制作阴影区域或交替背景颜色?
    查看>>
    Python:如何根据日期时间获取值的计数
    查看>>