Manage deploys behind HA.D/LVS/LDirector/HAProxy Load Balancers
Latest commit 16024e3 Sep 30, 2014 @TeamIguana version update

HALB, the High Availability Load Balancer gem

Build Status

It provides Ruby classes to control the maintenance state of machines behind HA.D/LVS/LDirector/HAProxy Load Balancers.

In the future we are planning to provide also integration with Capistrano.

How it works

This gem can control LDirector or HAProxy loadbalancer to instruct them to put or remove a machine from mantainance mode.


LDirector has a /etc/ha.d/maintenance directory where a file name 'serverx' says that serverx is in maintenance mode and thus must be removed as soon as possible from production. This gem manages the maintenace mode of servers using this kind of load balancers enabling smooth deploys without downtime.


HAProxy is instructed to put or remove a server from maintenance mode sending a command to it through a socket file.

Example with HAProxy

loadbalancers = ['loadbalancer01.localnet', 'root', SSH_KEY, '', ['proxy_name_1']),
          'loadbalancer02.localnet', 'root', SSH_KEY, '', ['proxy_name_1'])]
machines_hash = {'web1.service.localnet' => 'web1_srv', 'web2.service.localnet' => 'web2_srv'}
deploy = Halb::Deploy.with(loadbalancers, machines_hash)