2012-10-25 40 views
4

我使用Apache/mod_jk module來連接jboss。但經過一段時間後,出現了一些問題。運行一段時間後Apache/mod_jk模塊無法連接jboss

阿帕奇:2.2.22 mod_jk的:1.2.37 Jboss的:5.1.0 GA(羣集環境) OS:CentOS的5.2 x86_64的 JDK:1.6.0_30-B12

這裏是mod_jk的某些部分的.log的http.conf的

[Thu Oct 18 15:21:35.044 2012] [26272:47208100643936] [error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (node1) cping/cpong after connecting to the backend server failed (errno=110) 
[Thu Oct 18 15:21:35.044 2012] [26272:47208100643936] [error] ajp_send_request::jk_ajp_common.c (1630): (node1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=110) 
[Thu Oct 18 15:22:35.643 2012] [26272:47208100643936] [error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (node1) cping/cpong after connecting to the backend server failed (errno=110) 
[Thu Oct 18 15:22:35.643 2012] [26272:47208100643936] [error] ajp_send_request::jk_ajp_common.c (1630): (node1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=110) 
[Thu Oct 18 15:22:35.643 2012] [26272:47208100643936] [error] ajp_service::jk_ajp_common.c (2626): (node1) connecting to tomcat failed. 
[Thu Oct 18 15:23:36.143 2012] [26272:47208100643936] [error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (node2) cping/cpong after connecting to the backend server failed (errno=110) 
[Thu Oct 18 15:23:36.143 2012] [26272:47208100643936] [error] ajp_send_request::jk_ajp_common.c (1630): (node2) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=110) 
[Thu Oct 18 15:24:36.742 2012] [26272:47208100643936] [error] ajp_connect_to_endpoint::jk_ajp_common.c (1035): (node2) cping/cpong after connecting to the backend server failed (errno=110) 
[Thu Oct 18 15:24:36.742 2012] [26272:47208100643936] [error] ajp_send_request::jk_ajp_common.c (1630): (node2) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=110) 
[Thu Oct 18 15:24:36.742 2012] [26272:47208100643936] [error] ajp_service::jk_ajp_common.c (2626): (node2) connecting to tomcat failed. 
[Thu Oct 18 15:24:36.742 2012] [26272:47208100643936] [error] service::jk_lb_worker.c (1485): All tomcat instances failed, no more workers left 

部分:

JkWorkersFile conf/workers.properties 
JkMountFile conf/uriworkermap.properties 
JkLogFile logs/mod_jk.log 
JkLogLevel warn 

workers.properties:

worker.list=loadbalancer,loadbalancer_2,status 
worker.node1.port=8009 
worker.node1.host=10.123.76.6 
worker.node1.type=ajp13 
worker.node1.lbfactor=1 

worker.node2.port=8009 
worker.node2.host=10.123.76.4 
worker.node2.type=ajp13 
worker.node2.lbfactor=1 

worker.loadbalancer.type=lb 
worker.loadbalancer.balance_workers=node1,node2 

worker.loadbalancer.sticky_session=true 
worker.loadbalancer.sticky_session_force=false 

worker.loadbalancer_2.type=lb 
worker.loadbalancer_2.balance_workers=node1,node2 
worker.loadbalancer_2.sticky_session=true 
worker.loadbalancer_2.sticky_session_force=false 

注意事項:Jboss工作正常。 telnet jboss 8009是正常的。如果你重新啓動jboss,它會再次運行。但是,如果你重新啓動apache,它並沒有幫助。

任何人都遇到過這個問題?

+0

瞭解

更多的文檔? – user1516873

回答

3

我認爲設置連接超時ajp連接器將解決您的問題。 設置像這應該工作

<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3" 
     emptySessionPath="true" enableLookups="false" redirectPort="8443" maxThreads="1000" connectionTimeout="60000000" /> 

你在server.xml中,爲什麼你設置兩個相同loadbalansers配置此此屬性,你可以在官方的文檔http://docs.jboss.org/jbossweb/latest/config/ajp.html

+0

不好意思,'connectionTimeout'是什麼意思? –

+0

查詢http://docs.jboss.org/jbossweb/latest/config/ajp.html connectionTimeout: 此Connector將在接受連接後等待提交請求URI行的毫秒數。默認值是無限的(即沒有超時)。 它可能發生連接「掛起」,並且不會超時,並且會在連接池已滿後填充連接池(由max-threads控制),它將不會接受任何新連接,並且服務器將「過時」 – ctomc

1

您是否在server.xml文件中設置了正確的jvmRoute?

jboss-as/server/${profile}/deploy/jbossweb.sar/server.xml 

確切的行應該是這樣的:

<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1"> 

和第二臺服務器上會有=的jvmRoute 「節點2」。

+0

是的,我和你一樣 –

相關問題