我们有一个Tomcat7托管的webapp,有时候Tomcat会停止监听它应该的端口(我们收到一个Zabbix通知)
看来,在catalina.out中,我看到非标准字符串以:
开头8 1:16:45.305 DEBUG [localhost-startStop-2] IMPORTANT::TERMINATE_SIGNALED
net.sf.apr.eflow.Shutdown$ShowStackTrace: null
at net.sf.apr.eflow.Shutdown.terminate(Shutdown.java:296) [net_sf_apr.jar:na]
at net.sf.apr.web.ShutdownListener.stop(ShutdownListener.java:157) [net_sf_apr.jar:na]
at net.sf.apr.web.ShutdownListener.contextDestroyed(ShutdownListener.java:199) [net_sf_apr.jar:na]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4830) [tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5477) [tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) [tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1611) [tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1600) [tomcat-catalina-7.0.28.jar:7.0.28]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_72]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_72]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_72]
所以我怀疑这个过程被某些东西终止了。
当我运行“service tomcat7 status”时,我得到的结果就像“Tomcat没有运行,但是PID文件存在”
所以我必须“服务tomcat7 start”才能让它运行
如何找到此问题?我看过系统日志,但没有什么相关的。
什么可能导致Tomcat进程以这种方式终止?这是在Debian 7上,Tomcat运行为:
/usr/lib/jvm/java-7-oracle/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.awt.headless=true -Xmx16G -XX:MaxPermSize=15G -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start