tomcat假死重启脚本
最近几天老是出现tomcat假死的情况,主要表现为,进程还在,但是tomcat不再提供任何服务,并且日志也停止记录。
因为暂时无法定位原因,所以先采用临时的解决方案,服务器上增加脚本监控服务,假死发生时自动重启服务。
health_rsbi.sh 脚本内容如下:
#!/bin/bash
n=`curl -d "" http://172.18.2.29:8080/rsbi/403.jsp |grep "互联网" |wc -l`
if [ $n -ne 1 ]
then
/data/bi/tomcat/bin/shutdown.sh
m=`ps -ef | grep tomcat | grep -v grep | awk '{print $2}'`
kill -9 $m
/data/bi/tomcat/bin/startup.sh
fi
定时任务配置如下:
*/1 * * * * /data/bi/health_rsbi.sh>/data/bi/health.log
还没有评论,来说两句吧...