5 Replies Latest reply on Oct 29, 2014 5:33 AM by Mariusz Pietraś

    Multiple clusters

    Leandro Quiroga Newbie

      Hi, is it possible to have multiple clusters in the same httpd?

      How can I configure them?

      Thanks in advance

       

      Leandro

        • 1. Re: Multiple clusters
          Michal Karm Babacek Apprentice

          Dear Leandro,

          you can use load-balancing-group attribute in mod_cluster subsystem configuration [1] to split your worker nodes into separate load balancing groups.

          Note this has actually nothing to do with your clustering setup, it only tells the balancer that there are multiple discrete worker groups and that sessions created within one should be kept in it.

          I'm convinced that this is what you are looking for.

           

          [1] ha or full-ha profiles in domain or standalone-ha or standalone-full-ha in standalone mode with AS7 and WildFly. The same attribute for mod_cluster listener in Tomcat configuration is called loadBalancingGroup

          • 2. Re: Multiple clusters
            Jean-Frederic Clere Master

            Another way is to use different sessionid names (like MYSESSIONID instead JSESSIONID) and/or different balancers. Just configuration ;-)

            • 3. Re: Multiple clusters
              Leandro Quiroga Newbie

              Thanks Michal, Jean for your quick reply.

              I configured the load-balancing-group attribute in mod_cluster subsystem configuration but, how can I send requests to specific one of these balancing groups?

              What I want is to have multiple clusters of multiple jboss servers, each cluster balanced independently from the others, is that possible using only one instance of httpd?

               

              Architecture.jpg

               

              The load must balanced intra cluster not inter cluster, that is between JBoss 1.1 and JBoss 1.2 and independently between JBoss 2.1 and JBoss 2.2.

               

              Thanks in advance

              • 4. Re: Re: Multiple clusters
                Leandro Quiroga Newbie

                I solved it with the following configuration:

                 

                httpd.conf

                <IfModule manager_module>
                  Listen 127.0.0.1:6666
                  CreateBalancers 1
                  <VirtualHost 127.0.0.1:6666>
                    <Location />
                     Order deny,allow
                     Deny from all
                     Allow from 127.0.0.1
                    </Location>
                
                    ManagerBalancerName cluster1
                  
                    KeepAliveTimeout 300
                    MaxKeepAliveRequests 0
                    EnableMCPMReceive
                
                    <Location /mcm1>
                       SetHandler mod_cluster-manager
                       Order deny,allow
                       Deny from all
                       Allow from 127.0.0
                    </Location>
                
                    ProxyPass / balancer://cluster1/
                  </VirtualHost>
                
                  Listen 127.0.0.1:6667
                  <VirtualHost 127.0.0.1:6667>
                    <Location />
                     Order deny,allow
                     Deny from all
                     Allow from 127.0.0.1
                    </Location>
                
                    ProxyPass / balancer://cluster2/
                  
                    ManagerBalancerName cluster2
                  
                    KeepAliveTimeout 300
                    MaxKeepAliveRequests 0
                    EnableMCPMReceive
                  </VirtualHost>
                </IfModule>
                
                
                
                

                 

                Lines 24 and 35 do what I want.

                 

                standalone-ha-cluster1.xml

                <mod-cluster-config advertise-socket="modcluster" connector="ajp" proxy-list="127.0.0.1:6666">
                
                
                

                 

                standalone-ha-cluster2.xml

                <mod-cluster-config advertise-socket="modcluster" connector="ajp" proxy-list="127.0.0.1:6667">
                
                
                

                 

                jfclere

                Is this configuration ok?

                Mod_cluster documentation does not explain what ProxyPass directive do, or I didn't find it.

                I suppose "ProxyPass / balancer://cluster1/" says that all request sent to / must be redirected to the (balanced) cluster 1, I am right?

                Thanks

                • 5. Re: Multiple clusters
                  Mariusz Pietraś Newbie

                  Hi,

                  Does Leandro's solution work in practice? Anybody tried this one?

                   

                  Thanks