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

    Docker:mod_cluster and Tomcat

    digitraj81

      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 /172.17.0.2

      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://172.17.0.2:8009
      [Thu Jun 23 08:51:27.417524 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1785): AH00924: worker ajp://172.17.0.2 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://172.17.0.2 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 (172.17.0.2) 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 (172.17.0.2) 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 (172.17.0.2)
      [Thu Jun 23 08:51:27.418051 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2213): [client 10.193.149.209:56591] AH00944: connecting ajp://172.17.0.2:0/ to 172.17.0.2:8009
      [Thu Jun 23 08:51:27.418125 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2422): [client 10.193.149.209:56591] AH00947: connected / to 172.17.0.2:8009
      [Thu Jun 23 08:51:27.418356 2016] [proxy:error] [pid 1437:tid 140305676351232] (111)Connection refused: AH00957: ajp: attempt to connect to 172.17.0.2:8009 (172.17.0.2) failed
      [Thu Jun 23 08:51:27.418394 2016] [proxy:error] [pid 1437:tid 140305676351232] AH00959: ap_proxy_connect_backend disabling worker for (172.17.0.2) 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 (172.17.0.2)
      [Thu Jun 23 08:51:27.418424 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(2438): proxy_cluster_isup: pingpong ajp://172.17.0.2:0/ failed

      error

        • 1. Re: Docker:mod_cluster and Tomcat
          mbabacek

          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.

           

          Cheers

          -K-

          • 2. Re: Docker:mod_cluster and Tomcat
            digitraj81

            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.

             

            mod_cluster/1.3.2.Final

            Auto Refresh show DUMP output show INFO output

            Node tomcat786 (ajp://172.17.0.2:8009):

            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:

            Contexts:

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

            Aliases:

            localhost

             

            For this what are available solutions??

            • 3. Re: Docker:mod_cluster and Tomcat
              digitraj81

              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
                pmosca

                Hi Raj,

                 

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

                 

                Regards,

                Patrick