Searching HAProxy Enterprise 1.9r1
Implementing Route Health Injection (RHI)
Implementing Route Health Injection (RHI)
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.
How RHI works
RHI comprises two layers:
hapee-extras-route
daemons (one for IPv4 and one for IPv6) to interact with the infrastructure core routing system-
hapee-extras-rhi
daemon that analyzes HAProxy proxie's status (front ends or back ends) and updates route daemons following the rules described in its configurationThe diagram below shows these interactions:
hapee-extras-rhi
checks HAProxy's proxies every second.A proxy is considered as failing after 3 consecutive DOWN statuses.
When
hapee-1.9-lb
(HAProxy) is reloaded after a proxy is removed (but still checked), thenhapee-1.9-rhi
carries on using the last status reported for the missing proxy.
Install the RHI module
The RHI module is not installed with HAProxy Enterprise by default.
-
Install RHI using your package manager:
$ sudo apt install hapee-extras-rhi
-
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:
global stats socket /var/run/hapee-2.1/hapee-lb.sock user hapee-lb group hapee mode 660 level admin
-
Update the RHI settings to point to the socket's path by editing the file '/etc/default/hapee-extras-rhi' to add the following line:
HAPEE_LB_SOCKET="/var/run/hapee-2.1/hapee-lb.sock"
-
Enable and start the RHI service as follows:
$ sudo systemctl enable hapee-extras-rhi $ sudo systemctl start hapee-extras-rhi
Manage the RHI process
$ sudo service hapee-extras-route {start,stop,restart}
$ sudo service hapee-extras-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-extras/hapee-route.cfg
, as follows:
protocol volatile <protoname> {
[GATEWAY <ip>]
}
where:
| The name of the volatile protocol section. It is a label that the RHI daemon uses to inject routes. The default value is vol1. |
| 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-extras-rhi {start,stop,restart,reload}
Configure the RHI daemon
To configure the RHI daemon, you edit the file /etc/hapee-extras-rhi.conf
.
This file contains a list of routes to annoulnce based on rules. A rule is an aggregation of HAProxy's proxies 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.9-rhi applies a /32
|
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
|
Description of |
|
Example RHI configuration
To announce the IP address 10.200.200.200/32
when the backends be_static
and be_app
are available, add the following line into hapee-extras-rhi
configuration file:
10.200.200.200/32 = all(b:be_static,b:be_app)