1 Reply Latest reply on Aug 18, 2015 3:23 AM by Jean-Frederic Clere

    Geographically disparate mod_cluster and "lbset" functionality like mod_proxy_balancer?

    Gerald Turner Newbie

      I have an old Apache httpd mod_proxy_balancer and JBoss 4 load balancing setup that worked across a WAN consisting of:

      1. DNS round-robin ("www" record pointed to A records of httpd servers in "west" and "east" locations).
      2. mod_proxy_balancer configured to use "lbset" feature of BalancerMember directive so that traffic on "west" httpd prefers proxying to jbosses at the "west" location, so that traffic is only ever sent to the "east" jbosses if all "west" jbosses are down, and vice-versus for the opposite location (east prefers east).
      3. Exception to the previous statement is that "stickysession" is tracked and browser sessions that land on one jboss backend, will continue to route to the same backend (unless it goes down), even if traffic changes source to the opposite location.

       

      DNS records:

      west-httpd   10.11.11.10

       

      west-jboss-1 10.11.11.11

      west-jboss-2 10.11.11.12

       

      east-httpd   10.22.22.20

       

      east-jboss-1 10.22.22.21

      east-jboss-2 10.22.22.22

       

      www          west-httpd, east-httpd

       

      west-httpd httpd.conf:

      <Proxy balancer://app>

        BalancerMember ajp://west-jboss-1:8009 lbset=1 route=west-jboss-1

        BalancerMember ajp://west-jboss-2:8009 lbset=1 route=west-jboss-2

        BalancerMember ajp://east-jboss-1:8009 lbset=2 route=east-jboss-1

        BalancerMember ajp://east-jboss-2:8009 lbset=2 route=east-jboss-2

        ProxySet stickysession=JSESSIONID|jsessionid

      </Proxy>

       

      RewriteRule ^App/(.*) balancer://app/App/$1 [P,NE,L]

       

      east-httpd httpd.conf:

      <Proxy balancer://app>

        BalancerMember ajp://east-jboss-1:8009 lbset=1 route=east-jboss-1

        BalancerMember ajp://east-jboss-2:8009 lbset=1 route=east-jboss-2

        BalancerMember ajp://west-jboss-1:8009 lbset=2 route=west-jboss-1

        BalancerMember ajp://west-jboss-2:8009 lbset=2 route=west-jboss-2

        ProxySet stickysession=JSESSIONID|jsessionid

      </Proxy>

       

      RewriteRule ^App/(.*) balancer://app/App/$1 [P,NE,L]

       

      The "lbset" BalancerMember directive parameter is described as:

        "Sets the load balancer cluster set that the worker is a member of. The load balancer will try all members of a lower numbered lbset before trying higher numbered ones."

       

      I am trying to figure out the best approach with mod_cluster 1.3.1 and JBoss EAP 6.4.0.

       

      It will be difficult to pursue multicast between the two locations (although not impossible), so I'll be using explicit "proxy-list" configuration rather than mod_advertise.

       

      west-httpd and east-httpd httpd.conf:

      <VirtualHost *:6666>

        CreateBalancers 0

        ManagerBalancerName app

        AllowDisplay On

        EnableMCPMReceive

      </VirtualHost>

       

      <VirtualHost www:443>

        ProxyPass /App balancer://app/App

      </VirtualHost>

       

      west-jboss-1, west-jboss-2, east-jboss-1, and east-jboss-2 domain.xml:

      <mod-cluster-config advertise-socket="modcluster"

                          proxy-list="west-httpd:6666,east-httpd:6666"

                          advertise="false"

                          connector="ajp"/>

       

      Problem is that all BalancerMembers are treated equal.

       

      How can I get "lbset"-like functionality?

       

      I can envision writing a custom-load-metric based on round-trip-time, however are metrics calculated for each proxy in proxy-list (rather than once)?