If you’re willing to put in the effort checkout https://clusterlabs.org/.
If you can read German (or maybe use Google Translate), the following blog may be interesting for you as well:
https://herc.de/de/openhab2-hacluster-mit-pacemaker-und-corosync/