阿帕奇+ Tomcat 与 mod_jk - 网站挂起
我有一个在 Linux redhad 设置上使用 apache 1.3(启用 SSL)+ mod_jk + tomcat 5.5 的网站。就在最近,我的网站开始出现停机问题。每天一次,我的网站挂在端口 80 上。但是如果我直接通过 8080 tomcat 响应访问,网站工作正常。 80 和 8080 端口均可访问,但 apache 和 tomcat 与 mod_jk 的连接已损坏。只有在我重新启动tomcat后,一切才恢复正常。
我刚刚配置了 apache mod_Jk 来记录错误,因此我将看看下一次挂起时是否会出现任何错误。
apache mod_jsconf:
JkShmSize 1000M
apacheworkersconf:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.socket_keepalive=1
worker.worker1.recycle_timeout=180
worker.worker1.sticky_session=False
我检查了tomcat上的Web应用程序错误/警告日志,我有一些“内存不足”java异常。应用程序错误会导致此问题吗?可能是网站过载问题或内存泄漏?目前 dev/mapper/VolGroup00-LogVol00 只有 4% 的可用空间。这可能是问题的原因吗?
我还得到了这个日志条目,它与服务器挂起时间匹配:
/var/log/messages:端口 8009 上可能存在 SYN 泛洪。发送 cookie
更新: 我刚刚又得到了一个,mod_jk 日志给出了这个:
[Sun Nov 14 00:57:03 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): 无法接收来自 tomcat 的响应消息,网络问题或 tomcat is$ [Sun Nov 14 00:57:03 2010] [错误] ajp_get_reply::jk_ajp_common.c (1503): Tomcat 已关闭或拒绝连接。尚未向客户端发送任何回复 [Sun Nov 14 00:57:08 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): 无法接收来自 tomcat 的响应消息,网络问题或 tomcat is$ [Sun Nov 14 00:57:08 2010] [错误] ajp_get_reply::jk_ajp_common.c (1503): Tomcat 已关闭或拒绝连接。尚未向客户端发送任何回复 [Sun Nov 14 00:57:12 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): 无法接收来自 tomcat 的响应消息,网络问题或 tomcat is$ [Sun Nov 14 00:57:12 2010] [错误] ajp_get_reply::jk_ajp_common.c (1503): Tomcat 已关闭或拒绝连接。尚未向客户端发送任何回复 [Sun Nov 14 00:57:12 2010] [错误] ajp_service::jk_ajp_common.c (1758): 连接到 tomcat 时出错。 Tomcat 可能未启动或侦听错误的端口。 w$ [2010 年 11 月 14 日星期日 00:57:12]worker1 mydomain.com 50.999342 看起来
我的网站在 8009 端口上已关闭。 AJP 1.3 连接器在 8009 端口上为 apache mod_jk 提供服务。
任何帮助或建议将不胜感激。
谢谢。
I have a website with apache 1.3(SSL enabled) + mod_jk + tomcat 5.5 on Linux redhad setup. Just recently i started having a downtime problem with my web site. Once a day, i get my web site hang on port 80. But if i access directly through 8080 tomcat responses and web site works fine. Both 80 and 8080 ports are accessible but apache and tomcat connection with mod_jk is broken. Only after i restart tomcat, the things get back to normal.
I just configured apache mod_Jk to log the errors, so i will see if there will be any error on the next hang.
apache mod_js conf:
JkShmSize 1000M
apache workers conf:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.socket_keepalive=1
worker.worker1.recycle_timeout=180
worker.worker1.sticky_session=False
I checked web application error/warn logs on tomcat, i have some "out of memory" java exceptions. Can application errors cause this issue ? Can it be website overload problem or memory leak ? Currently dev/mapper/VolGroup00-LogVol00
has only 4% free space. Can it be a cause for the problem ?
I also got this log entry, it matchs the server hang time:
/var/log/messages: possible SYN flooding on port 8009. Sending cookies
Update:
I just got another down, the mod_jk log gives this:
[Sun Nov 14 00:57:03 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$
[Sun Nov 14 00:57:03 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet)
[Sun Nov 14 00:57:08 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$
[Sun Nov 14 00:57:08 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet)
[Sun Nov 14 00:57:12 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$
[Sun Nov 14 00:57:12 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet)
[Sun Nov 14 00:57:12 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. w$
[Sun Nov 14 00:57:12 2010] worker1 mydomain.com 50.999342
Looks my website is down on 8009 port. AJP 1.3 connector serves apache mod_jk on 8009 port.
Any help or advice would be highly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要更多数据。
1) 设置 apache 的服务器状态处理程序
2) 设置 mod_jk 的状态工作者。这样您就可以清楚地看到这是否是 apache 到 tomcat 的通信问题。
3)当tomcat再次挂起时,执行线程转储以查看Java处理当前的位置。也许它在等待什么。
编辑:如果是 apache 到 tomcat 的问题
([2])
,请查看 http://community.jboss.org/wiki/OptimalModjk12ConfigurationYou need more data.
1) setup the server-status handler for apache
2) setup the status worker of mod_jk. With this you'll then be able to clearly see whether this is a apache to tomcat communication problem.
3) when tomcat hangs again do a thread dump to see where the Java processing is currently at. Maybe it's waiting for something.
Edit: In case it's a problem of apache to tomcat problem
([2])
have a look at http://community.jboss.org/wiki/OptimalModjk12Configuration