zoukankan      html  css  js  c++  java
  • MHA监控进程异常退出

    这两天遇到一个非常诡异的问题,打算和大家分享一下。只所以诡异估计是自己知识面不够吧。线上的MHA一直没有开启自动切换,都是手动切换的,最近开启了自动切换以后,退出securecrt窗口以后发现监控进程异常自己退出了。报错日志如下:

    MHA版本:0.56

    Checking the Status of the script.. OK 
    Thu Jul 30 11:59:08 2015 - [info]  OK.
    Thu Jul 30 11:59:08 2015 - [warning] shutdown_script is not defined.
    Thu Jul 30 11:59:08 2015 - [info] Set master ping interval 5 seconds.
    Thu Jul 30 11:59:08 2015 - [warning] secondary_check_script is not defined. It is highly recommended setting it to check master reachability from two or more routes.
    Thu Jul 30 11:59:08 2015 - [info] Starting ping health check on 10.69.237.181(10.69.237.181:3306)..
    Thu Jul 30 11:59:08 2015 - [info] Ping(SELECT) succeeded, waiting until MySQL doesn't respond..
    Thu Jul 30 11:59:12 2015 - [info] Got terminate signal. Exit.

    可以看见日志里面有Got terminate signal. Exit.提示。启动方法和官方的没有区别,官方的启动监控进程如下:

     通过nohup挂到后台执行发现退出securecrt后监控进程就异常退出。有朋友说是securecrt的bug,这个还有待测试。最后采用把命令写到脚本里面,再执行就没有异常了。

    很简单,脚本start_monitor.sh如下:

    #!/bin/bash
    
    /usr/bin/nohup /usr/local/bin/masterha_manager --conf=/data/mha/3306/mha.cnf --ignore_last_failover > /data/mha/3306/log/manager.log 2>&1 &

    启动监控:

    /bin/bash start_monitor.sh 

    当然官方还提到另一种方法;使用daemon的方式运行,这个是为了避免MHA切换以后进程退出的方法。

     参考资料:

    https://code.google.com/p/mysql-master-ha/wiki/Runnning_Background

  • 相关阅读:
    【Python】数据写入Excel(封装后)
    【Charles】设置代理后 手机无法上网
    【Python】随机数/随机值
    【Python】操作JSON
    【Python】补零 不足位数补零
    【python】+操作yaml文件
    【Python】格式化输出JSON
    【Python】+系列教程(1、封装)
    【Python】+系列教程(总)
    【数据分析】+【Python】+股票数据分析
  • 原文地址:https://www.cnblogs.com/gomysql/p/4688920.html
Copyright © 2011-2022 走看看