0

I want to know, if there is a way to add/delete Apache2 mod_proxy_balancer balancer-members without doing a full restart of apache, so that the existing connections dont't get interrupted?

if i just update the members in the equal vhost-file and do a soft-restart via

service apache2 reload

apache wont apply the changes made. The provided balancer-manager directive and web backend allows to modify the parameters of the particular blanacer-member (e.g. loadfactor) without an restart, but its not possible to add new or delete existing members in this way.

chris
  • 169
  • 2
  • 11
  • I have a similar question. Can we add/delete additional members using http:/// without doing a restart. – Vijay Katam Jan 30 '13 at 19:18
  • the balancer-manager does not offer functionality to add new members, its only possible to enable/disable existing ones – chris Apr 13 '13 at 12:06

1 Answers1

0

finally, due to some infrequent problems regarding apache and mod_proxy_balancer (see https://issues.apache.org/bugzilla/show_bug.cgi?id=44736 for more details) i did a little workaround:

first of all filling up the balancer worker configuration with placeholders an setting loadfactor to "1", e.g.:

<Proxy balancer://mycluster>
   BalancerMember http://www.cmgm.info/virtual/1/  loadfactor=1
   BalancerMember http://www.cmgm.info/virtual/2/  loadfactor=1
   BalancerMember http://www.cmgm.info/virtual/3/  loadfactor=1
   BalancerMember http://www.cmgm.info/virtual/4/  loadfactor=1
   BalancerMember http://www.cmgm.info/virtual/5/  loadfactor=1
   ...
   BalancerMember http://www.cmgm.info/virtual/n/  loadfactor=1
</Proxy>

then mod_rewrite is used to dynamically assign the placeholders to real balancer memebers, e.g.:

RewriteEngine on
RewriteRule ^1/(.*)$ http://www.worker1.de/$1 [P]
RewriteRule ^2/(.*)$ http://www.worker2.de/$1 [P]
...
RewriteRule ^n/(.*)$ http://www.workern.de/$1 [P]

adding, deleteing, enabling, disabling and setting the loadfactor of each (virtual) member is done by accessing the balancer-manager webinterface.

to sum up, mod_proxy_balancer can be dynamicall modified programmatically using this workaround.

chris
  • 169
  • 2
  • 11
  • Suppose we wanna implement our own lbmethod, can we programmatically add/remove new worker? – mR.aTA Dec 05 '17 at 00:18