Generic high availability abstraction for application possible? [closed]

Pacemaker, Corosync, and DRBD are Linux projects that provide an, "Open Cluster Framework" (OCF), for making generic Linux services HA.

Typically, DRBD synchronously replicates the storage (at the block level), while Corosync and Pacemaker manage which nodes are running which services in the cluster. Services can be controlled via OCF resource-agents (shell scripts with standard exit codes and functions), or via the service's systemd/upstart/sysv-init scripts. There are also generic "anything" agents that can spawn and monitor processes in the cluster, but I'd use those only if you're feeling really lazy as it's not robust.

One of the easiest, most transparent ways to achieve generic HA, is to use Pacemaker and DRBD to create a KVM cluster. Where the VM has your application configured and started at boot, and Pacemaker/DRBD handle the clustering underneath (on the hypervisor).

There are plenty of resources online explaining the detailed steps if you Google around, but LINBIT has a tech-guide (behind a softwall) that steps through setting this up: https://linbit.com/tech-guide/drbd9-kvm-rhel8/

More Reference:
DRBD: https://linbit.com/
Pacemaker/Corosync: https://clusterlabs.org/