On 10/08/2008 11:21 PM, Vinicius Petrucci wrote:
> > Hi, > > ok. but if I cannot change the assignment of workers to balancer > during runtime, how do I duplicate the workers at startup? > where should I write the code for duplication? > > I've tried using the httpd.conf, e.g., > > <Proxy balancer://webapp1> > BalancerMember http://ampere:81 route=ampere loadfactor=20 > BalancerMember http://coulomb:81 route=coulomb loadfactor=10 > BalancerMember http://hertz:81 route=hertz loadfactor=10 > ProxySet lbmethod=byrequests > </Proxy> > > <Proxy balancer://webapp2> > BalancerMember http://ampere:81 route=ampere loadfactor=20 > BalancerMember http://coulomb:81 route=coulomb loadfactor=10 > BalancerMember http://hertz:81 route=hertz loadfactor=10 > ProxySet lbmethod=byrequests > </Proxy> > > but when Apache starts it outputs the following warning: > > [Wed Oct 08 18:14:48 2008] [warn] worker http://ampere:81 already used > by another worker > [Wed Oct 08 18:14:48 2008] [warn] worker http://coulomb:81 already > used by another worker > [Wed Oct 08 18:14:48 2008] [warn] worker http://hertz:81 already used > by another worker > > Is there any problem using this approach? The workers in your second balancer are not copies, but are the *same* workers as in your first balancer. So what can you do to create copies? If you web applications have context pathes do something like <Proxy balancer://webapp1/webapp1> BalancerMember http://ampere:81/webapp1 route=ampere loadfactor=20 BalancerMember http://coulomb:81/webapp1 route=coulomb loadfactor=10 BalancerMember http://hertz:81/webapp1 route=hertz loadfactor=10 ProxySet lbmethod=byrequests </Proxy> <Proxy balancer://webapp2/webapp2> BalancerMember http://ampere:81/webapp2 route=ampere loadfactor=20 BalancerMember http://coulomb:81/webapp2 route=coulomb loadfactor=10 BalancerMember http://hertz:81/webapp2 route=hertz loadfactor=10 ProxySet lbmethod=byrequests </Proxy> If not use different hostnames for your backend that point to the same IP addresses, e.g. ampere-webapp1 and ampere-webapp2 > > BTW: I'm planing to support multiple services (or applications) > associated to different (dynamic) group of servers. My cluster > configuration needs to be dynamic because the workload for the > different running applications varies according to the time. The point > is to change the overall cluster configuration (increase/decrease > servers on balancer X) depending the their loads. As Paul said, the best approach here is to setup a configuration like you did (with the small modifications I proposed) and let your module do some kind of "virtual operator" of the mod_proxy_balancer web interface by dynamically enabling and disabling the workers you like. Regards RĂ¼diger