6 Replies Latest reply on Dec 14, 2010 3:24 PM by augustsimonelli

    mod_cluster and multiple namevirtualhosts

    augustsimonelli

      Hello,

       

      I'm new to mod_cluster and looking for some basic advice on the following. I'm using JBoss EAP 5.1 (ie .com offering) and mod_clsuter 1.0.4 (also from red hat).

       

      mod_cluster installed as per the quikc start guide. using a proxyList and not multicast (ie -Djboss.modcluster.proxyList=10.68.15.8:6666). my cluster status page sees the node and deployed contexts (i put tomcat's sample.war in there). I can get there fine vie the server ip (ie http://10.68.15.8/sample/ - on port 80). The configs on apache are:

       

      LoadModule slotmem_module modules/mod_slotmem.so
      LoadModule manager_module modules/mod_manager.so
      LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
      LoadModule advertise_module modules/mod_advertise.so

       

      Listen 10.68.15.8:6666
      <VirtualHost 10.68.15.8:6666>

       

          <Directory />
              Order deny,allow
              allow from all
          </Directory>

       

          KeepAliveTimeout 60
          MaxKeepAliveRequests 0

       

          ManagerBalancerName mycluster
          AdvertiseFrequency 5

       

          CreateBalancers 0

       

       

       

      </VirtualHost>

       

      <Location /mod_cluster-manager>
          SetHandler mod_cluster-manager
          Order deny,allow
          Allow from all
      </Location>

       

      Now i'd like to access that via a virtual host so i do:

       

      <VirtualHost *:80>

       

          ServerAdmin webmaster@dummy-host.example.com
          DocumentRoot /var/www/html/jbsample/
          ServerName clusterbalance.com
          ErrorLog logs/dummy-host.example.com-error_log
          CustomLog logs/dummy-host.example.com-access_log common

       

      </VirtualHost>

       

      which means clusterbalance.com/sample should be the url ... but that doesn't work and throws:

       

      [Mon Nov 15 16:07:51 2010] [warn] proxy: No protocol handler was valid for the URL /sample/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

       

      which tells me i need more mod_cluster (proxy config).

       

      So i added:

       

      ProxyPass / balancer://mycluster/

       

      but that gives me:

       

      [Mon Nov 15 16:08:59 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state

       

      so i tried the various CreateBalancers options (0,1,2) but they all result in:

       

      [Mon Nov 15 16:10:27 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state

       

      So i missing something fundamental about how to tie the virtual into the backend.

       

      Can anyone help? I'm RTFM'ing but, sadly, still a little cnofused.

       

      I hope to have MANY virtuals on one apache tied into multiple different jboss instances behind them.

       

      Thanks,

       

      August

        • 1. Re: mod_cluster and multiple namevirtualhosts
          augustsimonelli

          this is the output of the cluster manager:

           

          balancer: [1] Name: mycluster Sticky: 1 [JSESSIONID]/[jsessionid] remove: 0 force: 0 Timeout: 0 Maxtry: 1
          node: [1:1],Balancer: mycluster,JVMRoute: hostname.mydomain.com:8009:jboss.web,Domain: [],Host: 10.68.15.8,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 1,ttl: 60,timeout: 0
          host: 1 [localhost] vhost: 1 node: 1
          context: 1 [/sample] vhost: 1 node: 1 status: 1
          • 2. Re: mod_cluster and multiple namevirtualhosts
            augustsimonelli

            actually ... when i ask for / with my above setup i get:

             

            [Mon Nov 15 16:51:36 2010] [error] proxy: CLUSTER: (balancer://mycluster). All workers are in error state

             

            and when i ask for /sample i get


            [Mon Nov 15 16:52:02 2010] [warn] proxy: No protocol handler was valid for the URL /sample. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

            • 3. Re: mod_cluster and multiple namevirtualhosts
              augustsimonelli

              turns out i was using apache 2.2.3 and not 2.2.14 :-)

               

              i've found if i have multiple mod_cluster virtuals (ie 6666, 6667, 6668) on one apache ... fronting multiple jboss clusters ... i can set my mod_cluster defaults in ONE of the virtuals and create unique balancers in each cluster virtual.

               

              those unique balancers can be accessed in each virtual by mod_rewrite and ensure i send traffic to the right cluster.

               

              red hat support advised i use rewrites, not proxypass directives so i have had to use createbalancers 0 as mod_rewrite (apparently) won't create the balancers.

               

              this works pretty well.

               

              i'm assuming this is "how you do it" but i'm not 100% sure. but mod_cluster is too good to miss out on so i will continue to find how to make it work for us!

              • 4. Re: mod_cluster and multiple namevirtualhosts
                augustsimonelli

                Ok ... multiple mod_cluster virtuals is not the right way :-)

                I'm now setting balancer names at the JBoss side ... Red Hat support + mod_cluster devs have advised "work form the bottom up."

                Now i'm in business ... works prefectly. :-)

                • 5. Re: mod_cluster and multiple namevirtualhosts
                  willemnoorduin

                  Hi,

                   

                  I think this answers also my post http://community.jboss.org/thread/160001, in which I try to connect two different named virtual host to two different JBoss-AS clusters.

                  Can you post in what xml file you have set the name of the balancer in your JBoss

                  • 6. Re: mod_cluster and multiple namevirtualhosts
                    augustsimonelli

                    Short answer:

                     

                    I added the following property to both the HA and regular settings sections (i'm using 1.0.4, 1.1.x doesn't have two sections):

                     

                    <property name="balancer">ogbalancer</property>

                     

                    of

                     

                    ./deploy/mod-cluster.sar/META-INF/mod-cluster-jboss-beans.xml

                     

                    I've put all the details of my setup as a reply to your post (http://community.jboss.org/thread/160001) ... hope it helps; i'm curious if it works for others.

                     

                    august