監控mysql、ndb進程重啟

來源:互聯網
上載者:User

標籤:mysql

mysql3306連接埠down#!/bin/bash######mysql monitor##while  :dosleep 80/usr/bin/nc localhost 3306 -w 2 &>/dev/nullh=0if [  -ne 0 ];then  /etc/init.d/mysql start  fidone#!/bin/bash######mysql monitor##while  :dosleep 80/usr/bin/nc localhost 3306 -w 2 &>/dev/nullh=0if [  -ne 0 ];then        mysqld --defaults-file=/data/mysqlc/my_cluster/conf/my.cnf --user=mysql&        sleep 60        mysql -u root -pdota.123 -e "select memc_servers_set(‘10.200.240.225:11211‘);"fidone80秒檢測一次mysql 服務,請求本地3306連接埠2次失敗,則重啟服務
ndb叢集管理節點#!/bin/bashndb_mgm=`ps aux|grep ndb_mgm|grep -v grep| wc -l`if [ "$ndb_mgm" == "0" ];then        ndb_mgmd -f /data/mysql/etc/config.ini --configdir=/data/mysql/etcfi
ndb叢集管理節點ndb_mgm=`pgrep ndb_mgm`if [ "$ndb_mgm" == "" ];then     /data/mysqlc/bin/ndb_mgmd -f /data/mysql/etc/config.ini --configdir=/data/mysql/etcfi
ndb叢集data節點#/bin/shwhile true;do  count=`ps -fe | grep "ndbd" | grep "defaults-file" | grep -v "grep"`  if [ "$?" != "0" ]; then    ndbd --defaults-file=/data/mysql/etc/my.cnf  fi  sleep 300done


本文出自 “我的營運之路” 部落格,謝絕轉載!

監控mysql、ndb進程重啟

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.