
We don’t need to manually add another IP to the server – keepalived will handle this. If you were to start up haproxy right now it would fail since the VIP is not configured on this box. Note that the frontend is an IP address that isn’t currently on the box. Let’s configure haproxy01p and 02p – they are going to have the same exact configs #/etc/haproxy/haproxy.cfg Feel free to install these on both HaProxy boxes. I’m on CentOs and both packages are in the default repository. I have 4 servers in play here – two HaProxy boxes and two web servers:ġ92.168.1.4 (this is the virtual ip address that will belong to both HaProxy boxes)įirst things first – Get HaProxy and KeepaliveD installed. Okay enough with the background let’s get into the configs: If the secondary node notices that the primary is gone (via a multicast keep alive control packet, hence the name) the secondary node will send a gratuitous ARP which says “Hey! I own this MAC and IP Address now!” While both nodes are up the primary will own a VIP (virtual ip address) and will respond to ARP’s for that IP address. With VRRP both nodes have a “real” ip and mac address. VRRP is a protocol which allows two routers to have one IP. Keepalived uses VRRP which is something familiar to me. Luckily keepalived has been tweaked to work with HaProxy offering a mechanism to check two HaProxy instances.


It’s written in C and can handle a LOT of traffic – however the former network engineer in me would not be able to sleep unless I had at least one method of HA. Once time freed up and they could afford to fix the bad path, they would do so.Īs everyone knows by know HaProxy is a beast. Instead of re-configuring their current environment I purposed we setup HaProxy on the same LAN at which the load balancing will happen. I was recently working with a client who’s network path toward their API was needlessly long and took a few too many hops. The design aspects of high availability carry over from hardware to software – and I love to design with these solutions.

I flock to software such as HaProxy, Varnish, Nginx, VyOS, and RabbitMQ to name a few. Starting my career as a network engineer I’m immediately drawn to the very “infrastructurey” components in my current position.
