In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Starts when the PostgreSQL Server process down is detected, and the running status has no action
# more pg_server_check.sh
#! / bin/sh
Export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Prefix=/etc/init.d
DAEMON= "$prefix/postgresql"
RUNN_STR= "server is running"
Pg_Status= `$DAEMON status | grep "$RUNN_STR"`
LOG_PATH=/opt/cron
CHECK_LOG=$LOG_PATH/pg_server_check.log
Error_log=$LOG_PATH/pg_server_check_Error.log
Echo "$Pg_Status"
DT_STR= `date +'% Y-%m-%d% HRV% MVR% S'`
If [- z "$Pg_Status"]
Then
Echo "Check Time: $DT_STR" > $Error_log
Echo "Error: PostgreSQL Server is down." > > $Error_log
Echo "$DAEMON start" | sh > > $Error_log
Else
Echo "Check Time: $DT_STR" > $CHECK_LOG
Echo "PostgreSQL Server is running,do nothing." > > $CHECK_LOG
Fi
Root user login, script added to cron
* / 2 * / opt/cron/pg_server_check.sh
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.