Achieving high availability with heartbeat
High availability is a crucial aspect of any website or web application, as it ensures that the website is always available and accessible to users, even in the event of server failures or other disruptions. One effective way to achieve high availability is through the use of heartbeat, a software program that monitors the status of servers in a network and automatically redirects incoming traffic to healthy servers in the event of a failure.
Heartbeat works by regularly checking the status of each server in the network, using a variety of techniques such as sending ping requests or checking for specific services to be running. If a server is found to be unhealthy, heartbeat will automatically redirect incoming traffic to other healthy servers in the network.
To achieve high availability with heartbeat, it is important to have multiple servers in the network, as this allows for redundancy and failover capabilities. These servers should be configured to run heartbeat, and should be monitored and managed carefully to ensure that they are always operating at their best.
In addition to providing high availability, heartbeat also offers other benefits, such as allowing for automatic scaling of the network to meet changing traffic needs, and providing detailed monitoring and reporting capabilities to help identify and troubleshoot potential issues.
How to achieve high availability with 100% uptime? We all know it is possible to have high availability website but the configuration might be too technical for some person. I have successfully simulated and achieve high availability web server using heartbeat software. Since we are using Centos 7, there are no binary heartbeat software for Centos 7, and we need to compile the software from a source code.
I simulate Heartbeat using only 4 servers. 2 servers for haproxy load balance share with heartbeat while 2 servers for web server. You can find the manual to install the haproxy here. Technically the simple diagram same as below;