Apache/mod_jk module fail to connect jboss after running some time

11,358

Solution 1

I think setting connection timeout for ajp connector would fix your problem. Setting like this should work

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

you configure this in server.xml

more documentation on this attribute you can read about in official docs http://docs.jboss.org/jbossweb/latest/config/ajp.html

Solution 2

Did you set correct jvmRoute in server.xml file?

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

exact line should look like this:

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

and on the second server there will be jvmRoute="node2".

Share:
11,358
爱国者
Author by

爱国者

Software developer; Having been programming in Java and Scala for nearly 5 years. Graduated with Bachelor in Information &amp; Computation Science from Guangdong University of Technology I find Stackoverflow as a great place to give something back to software community. I am interested in Scala, Java, Maven, Spring, Datanucleus, Android, Scalatra, nodejs, Play, Ruby, Python, Erlang, but Scala is my favorite programming language. If you are a Chinese Scala geek, welcome to join us into QQ group : 132569382.

Updated on July 20, 2022

Comments

  • 爱国者
    爱国者 almost 2 years

    I use Apache/mod_jk module to connect jboss. But after running some time, something goes wrong .

    Apache: 2.2.22 mod_jk: 1.2.37 Jboss: 5.1.0 GA(cluster environment) OS: CentOS 5.2 x86_64 JDK: 1.6.0_30-b12

    Here is some part of mod_jk.log

    [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
    

    part of http.conf:

    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
    

    Attentions: Jboss is working fine. telnet jboss 8009 is normal. If you restart jboss, it works again. But if you restart apache, it doesn't help。

    Anyone has ever encounter this problem ?