• MySQL集群监控


    mysql集群监控check_mysql_slave_run.sh

    sh_path=$(cd $(dirname $0);pwd)
    cd ${sh_path}
    
    port1="3306"
    
    param1="mysql服务"
    
    echo `date "+%Y-%m-%d %H:%M:%S"`
    
    sh check_mysql_login.sh xx.xx.xx.xx ${port1} ${param1}
    sh check_mysql_slave.sh xx.xx.xx.xx ${port1} ${param2}
    
    echo `date "+%Y-%m-%d %H:%M:%S"`
    

    mysql服务连接状态监控check_mysql_login.sh

    source ~/.bash_profile
    
    file_msg=""
    if [ $2 == 3306 ] 
    
    if [ `mysql ${dw5_3306} -ucmbh -h$1 -P$2 -e "show slave statusG;"|grep  "Master_User:"|grep -c "cmbh"` != "1" ] ;then
      file_msg=$3$1"mysql连接异常"
    fi
    
    ![](https://img2020.cnblogs.com/blog/2069550/202103/2069550-20210330150116840-1917728979.png)
    
    ##mysql主从连接状态监控check_mysql_slave.sh 
     
    source ~/.bash_profile
    
    file_msg=""
    
    if [ `mysql ${dw5_3306} -ucmbh -h$1 -P$2 -e "show slave statusG;"|grep -E "Slave_IO_Running:|Slave_SQL_Running:"|grep -c "Yes"` != "2" ] ;then
      file_msg="IP:_$1:$2;Mysql主从同步异常_时间:_`date +%Y-%m-%d_%H:%M:%S`"
    fi
    

  • 相关阅读:
    c-free5
    node.js模块
    cd
    bower
    atom插件
    反射(操作MetaData)
    1.Html
    SQL语句 把一个表的数据复制到另外一个表里面
    Redis 可视化工具
    C# 多文件压缩包
  • 原文地址:https://www.cnblogs.com/whiteY/p/14597094.html
Copyright © 2020-2023  润新知