我正在使用这个YAJSW在我的Centos 5.5机器上运行Java Daemon。认为它运行良好,但突然之间我注意到我得到这种错误,然后它只是下降。任何帮助我必须做些什么来避免这种问题?一旦遇到问题,我可以使用一些监控工具来监控和恢复吗?
以下只是错误列表的一部分。
NFO|3090/0|11-09-19 20:22:13|Controller State: LOGGED_ON -> PROCESS_KILLED
INFO|wrapper|11-09-19 20:22:13|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:22:13|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:22:13|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:22:13|stopping process with pid/timeout 3090 45000
INFO|3090/0|11-09-19 20:22:13|Controller State: PROCESS_KILLED -> WAITING_CLOSED
FINEST|3090/0|11-09-19 20:22:13|wrapper manager received stop command
INFO|3090/0|11-09-19 20:22:14|Controller State: WAITING_CLOSED -> USER_STOP
INFO|wrapper|11-09-19 20:22:14|stop config name null
INFO|wrapper|11-09-19 20:22:14|externalStop false
INFO|wrapper|11-09-19 20:22:14|exit code linux process 0
INFO|wrapper|11-09-19 20:22:14|killing 3090
INFO|3090/0|11-09-19 20:22:14|gobler execption OUTPUT 3090 null
INFO|3090/0|11-09-19 20:22:14|gobler execption ERROR 3090 null
INFO|3090/0|11-09-19 20:22:14|gobler terminated OUTPUT 3090
INFO|wrapper|11-09-19 20:22:14|process exit code: 0
INFO|3090/0|11-09-19 20:22:14|gobler terminated ERROR 3090
INFO|wrapper|11-09-19 20:22:14|set state RESTART_STOP->RESTART_WAIT
INFO|wrapper|11-09-19 20:22:19|set state RESTART_WAIT->RESTART_START
INFO|wrapper|11-09-19 20:22:19|starting Process
INFO|3090/0|11-09-19 20:22:19|Controller State: USER_STOP -> UNKNOWN
INFO|wrapper|11-09-19 20:22:19|Controller State: UNKNOWN -> WAITING
INFO|wrapper|11-09-19 20:22:20|working dir /usr/local
INFO|wrapper|11-09-19 20:22:20|error initializing script
INFO|wrapper|11-09-19 20:22:20|exec:/usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=-6288918147195966892 -Dwrapper.teeName=-6288918147195966892$1316434940036 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
INFO|wrapper|11-09-19 20:22:20|started process 8988
INFO|wrapper|11-09-19 20:22:20|started process with pid 8988
INFO|wrapper|11-09-19 20:22:20|set state RESTART_START->RUNNING
INFO|wrapper|11-09-19 20:22:34|Controller State: WAITING -> STARTUP_TIMEOUT
INFO|wrapper|11-09-19 20:22:34|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:22:34|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:22:34|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:22:34|stopping process with pid/timeout 8988 45000
INFO|wrapper|11-09-19 20:22:34|Controller State: STARTUP_TIMEOUT -> USER_STOP
INFO|wrapper|11-09-19 20:22:34|stop config name null
INFO|wrapper|11-09-19 20:22:34|externalStop false
INFO|wrapper|11-09-19 20:23:19|process did not stop after 45000 sec. -> hard kill
INFO|wrapper|11-09-19 20:23:19|killing 8988
INFO|wrapper|11-09-19 20:23:19|send kill sig
INFO|wrapper|11-09-19 20:23:19|exit code linux process 9
INFO|wrapper|11-09-19 20:23:19|Controller State: USER_STOP -> PROCESS_KILLED
INFO|8988/1|11-09-19 20:23:20|gobler execption OUTPUT 8988 null
INFO|8988/1|11-09-19 20:23:20|gobler execption ERROR 8988 null
INFO|wrapper|11-09-19 20:23:20|process exit code: 999
INFO|8988/1|11-09-19 20:23:20|gobler terminated OUTPUT 8988
INFO|8988/1|11-09-19 20:23:20|gobler terminated ERROR 8988
INFO|wrapper|11-09-19 20:23:20|set state RESTART_STOP->RESTART_WAIT
INFO|wrapper|11-09-19 20:23:25|set state RESTART_WAIT->RESTART_START
INFO|wrapper|11-09-19 20:23:25|starting Process
INFO|wrapper|11-09-19 20:23:25|Controller State: PROCESS_KILLED -> UNKNOWN
INFO|wrapper|11-09-19 20:23:25|Controller State: UNKNOWN -> WAITING
INFO|wrapper|11-09-19 20:23:25|working dir /usr/local
INFO|wrapper|11-09-19 20:23:25|error initializing script
INFO|wrapper|11-09-19 20:23:25|exec:/usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=-6288918147195966892 -Dwrapper.teeName=-6288918147195966892$1316435005686 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
INFO|wrapper|11-09-19 20:23:26|started process 8989
INFO|wrapper|11-09-19 20:23:26|started process with pid 8989
INFO|wrapper|11-09-19 20:23:26|set state RESTART_START->RUNNING
INFO|wrapper|11-09-19 20:23:40|Controller State: WAITING -> STARTUP_TIMEOUT
INFO|wrapper|11-09-19 20:23:40|restart process due to default exit code rule
INFO|wrapper|11-09-19 20:23:40|set state RUNNING->RESTART
INFO|wrapper|11-09-19 20:23:40|set state RESTART->RESTART_STOP
INFO|wrapper|11-09-19 20:23:40|stopping process with pid/timeout 8989 45000
INFO|wrapper|11-09-19 20:23:40|Controller State: STARTUP_TIMEOUT -> USER_STOP
INFO|wrapper|11-09-19 20:23:40|stop config name null
INFO|wrapper|11-09-19 20:23:40|externalStop false
INFO|wrapper|11-09-19 20:24:25|process did not stop after 45000 sec. -> hard kill
INFO|wrapper|11-09-19 20:24:25|killing 8989
INFO|wrapper|11-09-19 20:24:25|send kill sig
INFO|wrapper|11-09-19 20:24:25|exit code linux process 9
INFO|wrapper|11-09-19 20:24:25|Controller State: USER_STOP -> PROCESS_KILLED
INFO|8989/2|11-09-19 20:24:26|gobler execption OUTPUT 8989 null
INFO|8989/2|11-09-19 20:24:26|gobler execption ERROR 8989 null
INFO|wrapper|11-09-19 20:24:26|process exit code: 999
INFO|8989/2|11-09-19 20:24:26|gobler terminated OUTPUT 8989
INFO|8989/2|11-09-19 20:24:26|gobler terminated ERROR 8989
答案 0 :(得分:1)
您可以通过附加strace来跟踪linux进程正在执行的操作。
如果YAJSW本身存在问题,并且您正在寻找一个简单的包装器来保持您的工作正常运行,那么可以使用简单的bash脚本来完成。
until myjob; do
echo "restarting myjob"
sleep 10
done
只要myjob正在运行,第1行就是一个阻塞调用,如果它以0以外的任何东西退出,那么它将重新启动。
答案 1 :(得分:0)
你可以看一下:here - 这可能是资源泄漏。
答案 2 :(得分:0)
我在Windows上遇到了非常类似的包装器日志输出。在我的例子中,多个应用程序通过yajsw实例运行。看来在某些情况下,yajsw选择自动端口来监视Java应用程序无法正常工作。
在失败的yajsw实例中,添加
wrapper.port = 24572
解决了这个问题。修改wrapper.conf后重新创建服务。我只需要将它添加到失败的yajsw实例中;其他实例成功自动选择端口。端口号无关紧要,只需选择一个未使用的端口即可。