2

Using Apache mod-proxy-balancer, I would like to balance between two balancers. Is this possible?

Background:

We are in process of upgrading some of our server stack, and for a deployment process we want to slowly introduce the new stack by sending a small percent of users to the new one.

I have a balancer defined for the old stack, and a balancer defined for the new stack. What I would like is to have a 3rd balancer whose members are the other balancers.

Example:

<Proxy balancer://oldstack>
    BalancerMember http://10.10.10.5    retry=30 timeout=20 route=old1
    BalancerMember http://10.10.10.6    retry=30 timeout=20 route=old2
</Proxy>

<Proxy balancer://newstack>
    BalancerMember http://10.10.10.8    retry=30 timeout=20 route=new1
    BalancerMember http://10.10.10.9    retry=30 timeout=20 route=new2
</Proxy>

<Proxy balancer://entrypoint>
    BalancerMember balancer://oldstack  retry=30 timeout=20 route=old loadfactor=90  #90%
    BalancerMember balancer://newstack  retry=30 timeout=20 route=new loadfactor=10  #10%
    ProxySet stickysession=ROUTEID
</Proxy>

When I try to run this, it complains [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

Is this possible to have a BalancerMember be another balancer?

1
  • I have done it but to a different apache instance running balancer, never tried what you have above.
    – ETL
    Feb 20, 2014 at 17:33

1 Answer 1

0

The documentation is inconclusive, but I do not think you can do it this way, you'd need to dig into the mod_proxy_balancer to confirm. As @ETL suggested you may be able to do this by moving each balancer group to a separate Apache virtual host.

Or possibly, would something like this work?

<Proxy balancer://entrypoint>
  # Members of Old stack
  BalancerMember http://10.10.10.5 retry=30 timeout=20 route=old1 loadfactor=45
  BalancerMember http://10.10.10.6 retry=30 timeout=20 route=old2 loadfactor=45
  # Members of new stack
  BalancerMember http://10.10.10.8 retry=30 timeout=20 route=new1 loadfactor=5
  BalancerMember http://10.10.10.9 retry=30 timeout=20 route=new2 loadfactor=5
  ProxySet stickysession=ROUTEID
</Proxy>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .