Setting up failover with keepalived
When we host important sites or applications, especially those that may be critical to conducting business, high availability is a valuable addition to increase stability. In short, if we have a single server that serves a single resource, then we will experience downtime if something were to happen to that server. We may be able to recover from this situation fairly quickly by using a template, image, or some other backup and restore methodology to get back to a working state, but it's even faster to recover from such a situation if we are able to direct our users to an alternate server while we fix the primary, or implement some sort of logic to enable us to route users away from a problematic server.
There are many ways a situation like this can be handled, and keepalived
is one way we can see this in action quickly, as setting it up is fairly straightforward. Before we continue though, note that implementing a high availability or similar...