4 Replies Latest reply on Feb 12, 2018 10:22 AM by pmosca

    Docker:mod_cluster and Tomcat


      I am using mod_cluster using Docker in one UNIX machine and tomcat server using Docker in another unix machine.
      Mod_cluster is registered by tomcat
      Jun 23, 2016 8:38:56 AM org.jboss.modcluster.ModClusterService connectionEstablished
      INFO: MODCLUSTER000012: Catalina connector will use /

      but when i am trying to connect application using load balancer i am getting

      [Thu Jun 23 08:51:27.417396 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(293): Created: worker for ajp://
      [Thu Jun 23 08:51:27.417524 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1785): AH00924: worker ajp:// shared already initialized
      [Thu Jun 23 08:51:27.417613 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1832): AH00927: initializing worker ajp:// local
      [Thu Jun 23 08:51:27.417739 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1867): AH00930: initialized pool in child 1437 for ( min=0 max=25 smax=25
      [Thu Jun 23 08:51:27.417836 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1904): AH00932: ajp: worker for ( has been marked for retry
      [Thu Jun 23 08:51:27.417973 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2160): AH00942: ajp: has acquired connection for (
      [Thu Jun 23 08:51:27.418051 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2213): [client] AH00944: connecting ajp:// to
      [Thu Jun 23 08:51:27.418125 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2422): [client] AH00947: connected / to
      [Thu Jun 23 08:51:27.418356 2016] [proxy:error] [pid 1437:tid 140305676351232] (111)Connection refused: AH00957: ajp: attempt to connect to ( failed
      [Thu Jun 23 08:51:27.418394 2016] [proxy:error] [pid 1437:tid 140305676351232] AH00959: ap_proxy_connect_backend disabling worker for ( for 60s
      [Thu Jun 23 08:51:27.418403 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(1408): proxy_cluster_try_pingpong: can't connect to backend
      [Thu Jun 23 08:51:27.418411 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2175): AH00943: ajp: has released connection for (
      [Thu Jun 23 08:51:27.418424 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(2438): proxy_cluster_isup: pingpong ajp:// failed


        • 1. Re: Docker:mod_cluster and Tomcat

          Dear Raj,

          • the balancer container must be able to access the worker container on its IP address and port.
          • If you are running on a single host, it is enough if you expose ports and link these containers together (tell me, if you need any help with that)
          • If you are running on multiple hosts, you are gonna need some network provider
            • it could be Docker swarm cluster - Get started with multi-host networking
            • or it could be Weave (used to power Tutum, now Docker Cloud, but they will eventually move away from Weave to Swarm)
            • or Flannel (network overlay that powers Kubernetes and OpenShift)


          If you tell me what's your architecture design and the intended deployment, I could help you choose the right option and configure it for mod_cluster.




          • 2. Re: Docker:mod_cluster and Tomcat

            Hi Karm,


            Thanks for you reply...


            My Apche Load balancer is running in one host and Tomcat is running another host.


            Since in my tomcat server.xml i have given ip and host for apche server and i am able to see see the node.



            Auto Refresh show DUMP output show INFO output

            Node tomcat786 (ajp://

            Enable Contexts Disable Contexts Stop Contexts

            Balancer: mycluster,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 26,Ttl: 60000000,Status: NOTOK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 0

            Virtual Host 1:


            /testWeb, Status: ENABLED Request: 0 Disable Stop /, Status: ENABLED Request: 0 Disable Stop 




            For this what are available solutions??

            • 3. Re: Docker:mod_cluster and Tomcat

              Hi Karm,


              This is our deployment target:


              1. 1) We are going to setup tomcat in two host (different UNIX box)(e.g. IP address) to create an image and deploy our application on the same two hosts.
              2. 2) Secondly, we want to setup Apache and mod_cluster in another host (third UNIX box)
              3. 3) Till now I have set up one unix machine with tomcat, application and also configures modcluster in servr.xml of my running tomcat.

                     For creating mod_cluster I am using https://hub.docker.com/r/karm/mod_cluster-master-dockerhub/

              • 4. Re: Docker:mod_cluster and Tomcat

                Hi Raj,


                Did you find a solution for this? I'm facing the same issue.  Please let me know.