HAProxy Enterprise Documentation 1.6r2

Route Health Injection

Route Health Injection (RHI) is an optimized version of a third party software that allows for the control of routing protocol announcement based on the health of the network and the HAProxy Enterprise service for active/active clustering.

Install the RHI module

  1. Install RHI using your package manager:

    $ # On Debian/Ubuntu
    $ sudo apt-get install hapee-1.6r2-rhi
    $ # On CentOS/RedHat/Oracle
    $ sudo yum install hapee-1.6r2-rhi
  2. Make sure that you configured the HAProxy Enterprise socket, which enables the Runtime API, and which RHI uses to analyze the status of proxies and backends:

       stats socket /var/run/hapee-1.6/hapee-lb.sock user hapee-lb group hapee mode 660 level admin
  3. Update the RHI settings to point to the socket's path by adding the following line to the file /etc/default/hapee-1.6-rhi:

  4. Enable and start the RHI service:

$ sudo systemctl enable hapee-1.6-rhi
$ sudo systemctl start hapee-1.6-rhi

How RHI works

RHI comprises two layers:

  • The hapee-1.6-route daemons (one for IPv4 and one for IPv6) interact with the infrastructure's core routing system.

  • The hapee-1.6-rhi daemon analyzes the status of frontends or backends managed by HAProxy Enterprise and updates route daemons following the rules described in its configuration.

    The diagram below shows these interactions:

    HAProxy Enterprise Route Health Injection
  • The hapee-1.6-rhi daemon checks proxies every second.

  • A proxy is considered as failing after 3 consecutive DOWN statuses.

  • When HAProxy Enterprise is reloaded after a proxy is removed (but still checked), then hapee-1.6-rhi carries on using the last status reported for the missing proxy.

Manage the RHI process

$ sudo service hapee-1.6-route {start,stop,restart}
$ sudo service hapee-1.6-route6 {start,stop,restart}

Configure route

HAProxy Enterprise's bird version embeds a new protocol named volatile, which you declare in the configuration file /etc/hapee-1.6/hapee-route.cfg, as follows:

protocol volatile <protoname> {
  [GATEWAY <ip>]



The name of the volatile protocol section. It is a label that the RHI daemon uses to inject routes. The default value is vol1.

GATEWAY <ip> (optional)

You can force a network gateway. By default, it uses the gateway configured on the interface to announce the routes.

Manage the RHI daemon process

$ sudo service hapee-1.6-rhi {start,stop,restart,reload}

Configure the RHI daemon

To configure the RHI daemon, you edit the file /etc/hapee-1.6/hapee-rhi.cfg.

This file contains a list of routes to announce based on rules. A rule is an aggregation of a proxy's status check (frontend or backend).

Define a rule

<network>[,<network>,[...]] = <agg>(<frt-or-bck>[,<frt-or-bck>,[...]])


an IPv4 or IPv6 CIDR subnet. If none is provided, hapee-1.6-rhi applies a /32 [%<protoname>]{<ipv4>,<ipv6>}[/<mask>]

  • At least one network is required, but several can be announced. The separator is the comma ,

  • For advanced configuration, you can supply the name of a volatile protocol in the %<protoname> section (default is vol1)

Character =

splits the network list from the rule

To announce the listed networks, the rule must be valid.

The rule is an aggregation of conditions. A rule starts by a keyword either all, always or never followed by a list of proxies.

  • all: all proxies listed must be active in order to announce the routes

  • any: at least one of the proxies listed must be active in order to announce the routes

  • never: never announce the routes, whatever the status of the proxies listed. Used for debugging purposes

  • always: always announce the routes, whatever the status of the proxies listed. Used for debugging purposes

Description of proxies {b,f}:<name>

  • a letter to indicate the proxy type: f stands for frontend and b stands for backend

  • a separator, the colon :

  • <name>: a string representing the name of the proxy in the HAProxy Enterprise configuration

Example RHI configuration

To announce the IP address when the backends be_static and be_app are available, add the following line into hapee-1.6-rhi configuration file: = all(b:be_static,b:be_app)

Next up

Active/Standby Clustering