Making HAProxy highly available with Keepalived
In the previous recipe, we used HAProxy to give our web servers some redundancy. The challenge with that solution is we now have a failure point in the load balancer itself. When architecting for HA, you need to cover all points of failure to make sure there is redundancy and that there is no SPOF. In this recipe, we will use Keepalived to add some HA to our configuration. Keepalived is a software application that is open source and designed for Linux-based systems. Its main function is to manage network load balancing and failover, ensuring the HA of web services. Keepalived is often used alongside HAProxy. The software primarily uses the Virtual Router Redundancy Protocol (VRRP) to achieve fault tolerance and evenly distribute the load. Keepalived uses the following features to provide its redundancy:
- High availability: With Keepalived, you can establish a cluster of backup servers that utilize a shared Virtual IP (VIP) address...