jk经常死掉,看了一下mod_jk.log,大家帮忙看看。

jk经常死掉,看了一下mod_jk.log,大家帮忙看看。

公司网站这几天经常不能访问。ssh进去后,看了看mod_jk.log,发现这些错误:

[Tue Oct 24 18:42:01 2006] worker1 219.234.80.176 0.000353
[Tue Oct 24 18:42:01 2006] [5595:52064] [info]  jk_handler::mod_jk.c (197: Service error=0 for worker=worker1
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  jk_open_socket::jk_connect.c (445): connect to 127.0.0.1:8009 failed with errno=111
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:8009) with
(errno=111)
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_send_request::jk_ajp_common.c (1251): Error connecting to the backend server.
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=1
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  jk_open_socket::jk_connect.c (445): connect to 127.0.0.1:8009 failed with errno=111
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:8009) with
(errno=111)
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_send_request::jk_ajp_common.c (1251): Error connecting to the backend server.
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=2
[Tue Oct 24 18:42:07 2006] [5621:52064] [error] ajp_service::jk_ajp_common.c (1794): Error connecting to tomcat. Tomcat is probably not starte
d or is listening on the wrong port. worker=worker1 failed
[Tue Oct 24 18:42:07 2006] worker1 mall.haohao.com 0.000414
[Tue Oct 24 18:42:07 2006] [5621:52064] [info]  jk_handler::mod_jk.c (197: Service error=0 for worker=worker1
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_send_request::jk_ajp_common.c (117: Socket 29 is not connected any more (errno=-1)
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_send_request::jk_ajp_common.c (1202): Error sending request. Will try another pooled conne
ction
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_send_request::jk_ajp_common.c (1224): All endpoints are disconnected or dead
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=1
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  jk_open_socket::jk_connect.c (445): connect to 127.0.0.1:8009 failed with errno=111
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:8009) with
(errno=111)
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_send_request::jk_ajp_common.c (1251): Error connecting to the backend server.
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=2
[Tue Oct 24 18:42:08 2006] [5625:52064] [error] ajp_service::jk_ajp_common.c (1794): Error connecting to tomcat. Tomcat is probably not starte
d or is listening on the wrong port. worker=worker1 failed
[Tue Oct 24 18:42:08 2006] worker1 www.haohao.com 0.000321
[Tue Oct 24 18:42:08 2006] [5625:52064] [info]  jk_handler::mod_jk.c (197: Service error=0 for worker=worker1
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  jk_open_socket::jk_connect.c (445): connect to 127.0.0.1:8009 failed with errno=111
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:8009) with
(errno=111)
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_send_request::jk_ajp_common.c (1251): Error connecting to the backend server.
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=1
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  jk_open_socket::jk_connect.c (445): connect to 127.0.0.1:8009 failed with errno=111
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:8009) with
(errno=111)
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_send_request::jk_ajp_common.c (1251): Error connecting to the backend server.
[Tue Oct 24 18:42:10 2006] [5583:52064] [info]  ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed,  recoverable operation
attempt=2
[Tue Oct 24 18:42:10 2006] [5583:52064] [error] ajp_service::jk_ajp_common.c (1794): Error connecting to tomcat. Tomcat is probably not starte
d or is listening on the wrong port. worker=worker1 failed


重启tomcat后,就可以了。

请大家帮忙看看,是什么原因? 先谢了。
我也想知道原因,顶上去
是tomcat宕了,应该查tomcat的日至。
楼上正确。

或者可以设置crontab,定期重启tomcat
真是tomcat的问题,那就晕了,我也有这个问题
今天我也刚遇到这种错误,不知道怎么解决。。
不知道是什么原因导致tomcat错误。。。。。。
首先检查Tomcat是否正常,

我以前测试过,mod_jk确定不稳定,并发连接多的话,就会有些连接是断掉的。

后面是用mod_proxy
发现同样的问题,如果先启动apache,后tomcat,mod_jk.log报错:

QUOTE:
[Sat Dec 20 16:38:10.562 2008] [2887:3086804672] [info] jk_handler::mod_jk.c (2476): Service error=-3 for worker=ajp1
[Mon Dec 22 07:50:42.259 2008] [2883:3086165696] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 07:50:42.586 2008] [2889:3086165696] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 08:41:52.555 2008] [2905:3086165696] [info] ajp_send_request::jk_ajp_common.c (1456): (ajp1) all endpoints are disconnected, detec
ted by connect check (1), cping (0), send (0)
[Mon Dec 22 08:41:52.868 2008] [2904:3086165696] [info] ajp_send_request::jk_ajp_common.c (1456): (ajp1) all endpoints are disconnected, detec
ted by connect check (1), cping (0), send (0)
[Mon Dec 22 08:41:52.953 2008] [2894:3086165696] [info] ajp_send_request::jk_ajp_common.c (1456): (ajp1) all endpoints are disconnected, detec
ted by connect check (1), cping (0), send (0)
[Mon Dec 22 08:42:06.667 2008] [2897:3086165696] [info] ajp_send_request::jk_ajp_common.c (1456): (ajp1) all endpoints are disconnected, detec
ted by connect check (1), cping (0), send (0)
[Mon Dec 22 08:42:07.030 2008] [2903:3086165696] [info] ajp_send_request::jk_ajp_common.c (1456): (ajp1) all endpoints are disconnected, detec
ted by connect check (1), cping (0), send (0)
[Mon Dec 22 08:55:59.869 2008] [2889:3086165696] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 12:50:04.412 2008] [5313:3086939840] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 12:50:04.669 2008] [5314:3086939840] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 14:58:55.548 2008] [5318:3086939840] [info] ajp_process_callback::jk_ajp_common.c (1748): Writing to client aborted or client netw
ork problems
[Mon Dec 22 14:58:55.550 2008] [5318:3086939840] [info] ajp_service::jk_ajp_common.c (2407): (ajp1) sending request to tomcat failed (unrecove
rable), because of client write error (attempt=1)
[Mon Dec 22 14:58:55.558 2008] [5318:3086939840] [info] jk_handler::mod_jk.c (2469): Aborting connection for worker=ajp1
[Mon Dec 22 15:01:15.580 2008] [5318:3086939840] [info] ajp_process_callback::jk_ajp_common.c (1748): Writing to client aborted or client netw
ork problems
[Mon Dec 22 15:01:15.580 2008] [5318:3086939840] [info] ajp_service::jk_ajp_common.c (2407): (ajp1) sending request to tomcat failed (unrecove
rable), because of client write error (attempt=1)
[Mon Dec 22 15:01:15.584 2008] [5318:3086939840] [info] jk_handler::mod_jk.c (2469): Aborting connection for worker=ajp1
[Mon Dec 22 15:19:57.536 2008] [3683:3086616256] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized
[Mon Dec 22 15:19:57.803 2008] [3684:3086616256] [info] init_jk::mod_jk.c (3018): mod_jk/1.2.27 initialized

等一会就没有问题
使用apache 2.0.52
mod_jk 1.2.27