In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following is about the scripting method of designing automatic monitoring to synchronize from MySQL. The secret of the text is to be close to the topic. So, no more gossip, let's go straight to the following, and I'm sure you'll benefit from this article on designing scripting methods for automatic monitoring from MySQL synchronization.
Script design ideas:
1. This script should be able to adapt to a variety of different internal and external network environments, that is, different IP environments.
2. Let the script monitor whether MySQL is running properly.
3. The IO and SQL status of Slave machines must be YES, which is indispensable. Multiple conditional judgment-an is used here.
#! / bin/bash#check MySQL_Slave Status#crontab time 00grep 10MaillUserlistings MysqlUserkeeper MYSQLPORT = `netstat-na | grep "LISTEN" | grep "3306" | awk-F [: "] +'{print $5} '`MYSQLIP= `ifconfig eth0 | grep" inet addr "| awk-F [:"] +' {print $4} '`STATUS=$ (/ usr/local/mysql/bin/mysql-u $MysqlUser-$MysqlPass-e "show slave status\ G" | grep-I "running") IO_env= `echo $STATUS | grep IO | awk' {print $2} '`SQL_ Env= `echo $STATUS | grep SQL | awk'{print $2} '`if ["$MYSQLPORT" = "3306"] thenecho "mysql is running" else/bin/mail-s "warningshipserver: $MYSQLIP mysql is down" $Mail-listfiif ["$IO_env" = "Yes"-a "$SQL_env" = "Yes"] thenecho "Slave is running!" elseecho "# $date #" > / tmp/check_mysql_slave.logecho "Slave is not running! "> > / tmp/check_mysql_slave.logecho" Slave is not running! "# mail-s" warn! $MySQLIP_replicate_error "$Mail-list
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.