Monitor MySQL, NDB process restart

Source: Internet
Author: User

mysql3306 Port down#!/bin/bash##### #mysql monitor# #while:d osleep 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:d osleep 80/usr/bin/nc Localhos T 3306-w 2 &>/dev/nullh=0if [-ne 0];then mysqld--defaults-file=/data/mysqlc/my_cluster/conf/my.cnf--us er=mysql& Sleep mysql-u root-pdota.123-e "Select Memc_servers_set (' 10.200.240.225:11211 ');" Fidone80 seconds to detect MySQL service, request local 3306 Port 2 times failed, restart service
NDB Cluster Management node #!/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 Cluster Management node 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 Cluster Data node #/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


This article is from the "my operation and maintenance of the road" blog, declined reprint!

Monitor MySQL, NDB process restart

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.