Is there a load balancer that will allow me to take down a server manually when deploying? [closed]

It seems like HAProxy doesn't allow this. We have Tomcat servers on the backend and are planning to use Apache + mod_jk to load balance. We're considering switching to something more full-featured like Netscaler but I'm not sold since part of what I'm looking for is the ability to do a seamless deployment where I could remove one of the Tomcat servers from the load balancer before rebooting it.


HAProxy allows you to do this by passing a command into the stats socket to disable the server. This will drain the connections (existing connections to this server will persist, but no new connections will be made to it).

This page gives a good summary of the commands available: http://code.google.com/p/haproxy-docs/wiki/UnixSocketCommands

and a disable example:

echo "disable server <backend_name>/<server_name>" | socat stdio /var/run/haproxy.stat

where /var/run/haproxy.stat is the UNIX domain socket for the commands, which is configured in the haproxy config file like so:

global
    stats socket /var/run/haproxy.stat mode 600 level admin

alongside any other global options.

Not you don't have to communicate on the socket via socat, you can connect to it like any other UNIX domain socket, which is quite straightforward in Python, Perl, PHP, C, etc. socat is mainly used in examples for convenience.


Apache can do it if you use mod_proxy instead of mod_jk; mod_proxy_balancer can integrate with mod_status for a mess-with-balancer-nodes page. See here.


I use LVS (www.linuxvirtualserver.org), which allows you to change a server's weight or remove it from rotation any time. Very handy when I need to install updates on web servers.


So long as your application allows user session-state to be served from all of the servers behind the load-balancer, pretty much all load-balancers support this. If your application sessions are sticky to the physical server the user is communicating with, your best bet is to disallow new connections to the server you want to take out of service and wait until the sessions have all closed. Depending on your app, this could be seconds or hours.