Establishing services' high availability using HAProxy
For this section, we are going to show in brief how to setup a high-availability/load balancer to control traffic over a specific service; in our case, we will use HTTP as for web server's traffic.
For this job, we are using HAProxy as an open source solution for load balancing and services' high availability through multiple servers. It is commonly used for a website's traffic load balancing. HAProxy distributes the workload over many servers that offer the same services (basically web servers, databases, and so on) to improve the overall performance of the service and its reliability.
As we said earlier, this section is going to install and configure a high availability load balancer to share the load between three web servers and a backup server in case of server or service failure to take over.
So, we will have an infrastructure that looks like this:
HAProxy server:
OS: CentOS 7
IP address: 172.25.25.166...