我在一组三个 tomcat6 服务器前面有一个 Apache 服务器(服务器版本:Apache/2.2.22 (Ubuntu))。Apache 使用 mod_proxy 和 AJP 连接器设置为负载平衡器:
<VirtualHost *:80>
ProxyRequests off
<Proxy balancer://mycluster>
BalancerMember ajp://localhost:8009 keepalive=On retry=1 timeout=15 ping=1
BalancerMember ajp://10.0.3.152:8009 keepalive=On retry=1 timeout=15 ping=1
BalancerMember ajp://10.0.3.153:8009 keepalive=On retry=1 timeout=1 ping=15
Order Deny,Allow
Deny from none
Allow from all
ProxySet lbmethod=byrequests
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Allow from all
</Location>
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
</VirtualHost>
Tomcat 使用以下 JAVA_OPTS 运行:
-Xms2048m -Xmx2048m -XX:NewSize=256m
-XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m
系统工作正常,但是过了一会儿我从 Tomcat 收到这些错误:
org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
而这个来自 Apache:
[error] ajp_read_header: ajp_ilink_receive failed
[error] (70007)The timeout specified has expired: proxy: read response failed from 127.0.0.1:8009 (localhost)
[error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header
我必须重新启动 Tomcat 才能让它再次工作。
知道发生了什么吗???谷歌搜索了一段时间后,这似乎是一个很常见的问题,但是我没有找到合适的解决方案。
谢谢你的帮助!