无码视频在线观看,99人妻,国产午夜视频,久久久久国产一级毛片高清版新婚

  • 始創(chuàng)于2000年 股票代碼:831685
    咨詢熱線:0371-60135900 注冊有禮 登錄
    • 掛牌上市企業(yè)
    • 60秒人工響應(yīng)
    • 99.99%連通率
    • 7*24h人工
    • 故障100倍補(bǔ)償
    全部產(chǎn)品
    您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

    MySQL 復(fù)制檢測腳本

    發(fā)布時間:  2012/9/16 14:19:46

    以下是根據(jù)網(wǎng)上的腳本整理,并結(jié)合實際進(jìn)行改進(jìn)。

    #!/bin/sh

    usage="$0 -hlocalhost -uroot -pxxxx -P3306"
    dbhost="localhost"
    dbuser=""
    dbpass=""
    dbport=3306

    for varin in $* ; do
     if [ ${varin:0:2} = '-h' ] ; then-
     

         dbhost=${varin:2}
      fi
     if [ ${varin:0:2} = '-u' ] ; then
         dbuser=${varin:2}
      fi
     if [ ${varin:0:2} = '-p' ] ; then
         dbpass=${varin:2}
      fi

     if [ ${varin:0:2} = '-P' ] ; then
         dbport=${varin:2}
      fi
    done

    echo $dbhost
    echo $dbuser
    echo $dbpass
    echo $dbport

    now=`date +"%Y%m%d%H%M%S"`
    datelog=`date +"%Y-%m-%d %H:%M:%S"`
    StatFile="./slave_status.$now"
    checklogfile="/var/log/mysql_slavecheck.log"
    echo "show slave status\G" | /usr/local/mysql/bin/mysql -u$dbuser -p$dbpass -h$dbhost -P$dbport > $StatFile


    #get io_thread,sql_thread,last_errno status
    #*************************** 1. row ***************************
    #             Slave_IO_State: Connecting to master
    #                Master_Host: 192.168.213.5
    #                Master_User: synuser
    #                Master_Port: 3306
    #              Connect_Retry: 60
    #            Master_Log_File: mysql-bin.000019
    #        Read_Master_Log_Pos: 366270403
    #             Relay_Log_File: Test-Web1-relay-bin.003133
    #              Relay_Log_Pos: 98
    #      Relay_Master_Log_File: mysql-bin.000019
    #           Slave_IO_Running: No
    #          Slave_SQL_Running: Yes
    #            Replicate_Do_DB:
    #        Replicate_Ignore_DB:
    #         Replicate_Do_Table:
    #     Replicate_Ignore_Table:
    #    Replicate_Wild_Do_Table:
    #Replicate_Wild_Ignore_Table:
    #                 Last_Errno: 0
    #                 Last_Error:
    #               Skip_Counter: 0
    #        Exec_Master_Log_Pos: 98
    #            Relay_Log_Space: 98
    #            Until_Condition: None
    #             Until_Log_File:
    #              Until_Log_Pos: 0
    #         Master_SSL_Allowed: No
    #         Master_SSL_CA_File:
    #         Master_SSL_CA_Path:
    #            Master_SSL_Cert:
    #          Master_SSL_Cipher:
    #             Master_SSL_Key:
    #      Seconds_Behind_Master: NULL
    IOSTAT=`grep "Slave_IO_Running" $StatFile |awk '{print $2}'`
    SQLSTAT=`grep "Slave_SQL_Running" $StatFile |awk '{print $2}'`
    Last_Errno=`grep "Last_Errno" $StatFile |awk '{print $2}'`
    Last_Error=`grep "Last_Error" $StatFile |awk '{print $2}'`
    Behind_Master=`grep "Seconds_Behind_Master" $StatFile |awk '{print $2}'`
    if [ $IOSTAT = 'No' ] || [ $SQLSTAT = 'No' ] ; then
       echo "Server $dbhost:$dbport Slave is down,Check Time is :$datelog " > $checklogfile

    if [ $Behind_Master = 'NULL' ] ; then
       echo "Server $dbhost:$dbport Slave not support slave-master,Check Time is :$datelog " >> $checklogfile
    else
       echo ">>Last_ErrNo:$Last_Errno" >>$checklogfile
       echo ">>Last_Error:$Last_Error" >>$checklogfile
       echo ">>slave is behind master $Behind seconds!" >>$checklogfile
    fi
    fi
    /bin/rm -rf $StatFile


    本文出自:億恩科技【mszdt.com】

    服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營性ICP/ISP證:贛B2-20080012
  • 服務(wù)器/云主機(jī) 24小時售后服務(wù)電話:0371-60135900
  • 虛擬主機(jī)/智能建站 24小時售后服務(wù)電話:0371-60135900
  • 專注服務(wù)器托管17年
    掃掃關(guān)注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號
      1
     
     
     
     

    0371-60135900
    7*24小時客服服務(wù)熱線