前景提要
HDC调试需求开发(15万预算),能者速来!>>>
我现在的Tomcat和jboss部署在电信机房,由于网络的问题,网通用户几乎无法访问,然后我找了一个多线机房安装Apache2.2代理,网络速度也还可以,但碰到一个比较头大的问题,就是经常发生第一次访问系统时会出现延迟的现象,访问成功后如果一直浏览就不会有这种现象了,查了很多资料说是AJP的Timeout的问题,但是都没有解决。后来换mod_proxy_ajp也是一样,Apache中出错的日志信息如下:
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
[error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (jboss8109_mc1) cping/cpong after connecting to the backend server failed (errno=60)
[error] ajp_send_request::jk_ajp_common.c (1630): (jboss8109_mc1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=60)
Apache中相关的配置:
<IfModule !mod_jk.c>
LoadModule jk_module conf/jk/mod_jk.so
</IfModule>
JkWorkerProperty worker.list=mccontroller,status
JkWorkerProperty worker.mccontroller.type=lb
JkWorkerProperty worker.mccontroller.balance_workers=jboss8109_mc1,jboss8109_mc2
# To select the best worker: B[usyness]-not busy, R[equest]-default
JkWorkerProperty worker.mccontroller.method=B
# sticky_session sticky_session_force desc
# true false SESSION会复制,有粘性
# true true SESSION不复制,有粘性
# false false SESSION会复制,有粘性
# false true SESSION不复制,有粘性
# true - 请求始终由当前的tomcat处理
JkWorkerProperty worker.mccontroller.sticky_session=true
# false - 当前tomcat挂了时,将session复制到另一台继续
JkWorkerProperty worker.mccontroller.sticky_session_force=false
JkWorkerProperty worker.status.type=status
## ============= jboss8109_mc1 =============== ##
JkWorkerProperty worker.jboss8109_mc1.port=8109
JkWorkerProperty worker.jboss8109_mc1.host=117.25.149.1
JkWorkerProperty worker.jboss8109_mc1.type=ajp13
JkWorkerProperty worker.jboss8109_mc1.lbfactor=1
JkWorkerProperty worker.jboss8109_mc1.socket_keepalive=True
JkWorkerProperty worker.jboss8109_mc1.socket_timeout=0
JkWorkerProperty worker.jboss8109_mc1.ping_mode=A
JkWorkerProperty worker.jboss8109_mc1.connect_timeout=600
JkWorkerProperty worker.jboss8109_mc1.connection_pool_timeout=600
JkWorkerProperty worker.jboss8109_mc1.retries=3
JkWorkerProperty worker.jboss8109_mc1.recovery_options=3
## ============= jboss8109_mc2 =============== ##
JkWorkerProperty worker.jboss8109_mc2.port=8109
JkWorkerProperty worker.jboss8109_mc2.host=117.25.149.2
JkWorkerProperty worker.jboss8109_mc2.type=ajp13
JkWorkerProperty worker.jboss8109_mc2.lbfactor=1
JkWorkerProperty worker.jboss8109_mc2.socket_keepalive=True
JkWorkerProperty worker.jboss8109_mc2.socket_timeout=0
JkWorkerProperty worker.jboss8109_mc2.ping_mode=A
JkWorkerProperty worker.jboss8109_mc2.connect_timeout=600
JkWorkerProperty worker.jboss8109_mc2.connection_pool_timeout=600
JkWorkerProperty worker.jboss8109_mc2.retries=3
JkWorkerProperty worker.jboss8109_mc2.recovery_options=3
JkLogFile "logs/mc_mod_jk.log"
JkLogLevel warn
##JkLogLevel emerg
##JkLogLevel debug
HostnameLookups Off
<VirtualHost www.test.com:80 >
ServerName www.test.com
Header set P3P 'CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'
JkMount /jkstatus status
JkMount /* mccontroller
</VirtualHost>
<VirtualHost *:80>
ServerName app.test.com
Header set P3P 'CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'
JkMount /* mccontroller
</VirtualHost>
JBOSS中Server.xml中connector中AJP配置如下:
<Connector port="8109" address="${jboss.bind.address}" redirectPort="8443" protocol="AJP/1.3"
maxHttpHeaderSize="8192" strategy="ms" emptySessionPath="true"
maxThreads="1000" minSpareThreads="100" maxSpareThreads="500"
enableLookups="false" acceptCount="100" URIEncoding="GBK"
disableUploadTimeout="true"
compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/javascript, text/css, text/plain,application/xhtml+xml,application/x-javascript,application/javascript,text/xhtml"
/>
看了一些资料,加入connectionTimeout=600000也是不行。
不知道有没有人碰到过同样的问题,调试了好几天了,求解。谢谢