DigitalOcean floating IP failover script
1.3K
do-failover - automatic failover for HTTP(S) based services on DigitalOceando-failover helps you switch between a main and hot-standby server on [DigitalOcean][do] (using their Floating IP feature).
API_KEY: Your digitalocean.com API keyFAILOVER_MODE: 'main' or 'standby' (or disabled if not set)FLOATING_IP: the IP that's been shared by the main and standby serverFAILOVER_CHECK: local URL(s) to check to determine the health of this server (split by '|')FAILOVER_MAIN: URL(s) of the main server (if we're on the standby server) (URLs are split by '|')FAILOVER_MAIN_HOST (optional): Set the 'Host' header for requests to FAILOVER_MAIN URLs (allows to ignore DNS while still checking the validity of SSL certs)There are two modes: main and standby:
main:When in main mode, the failover script will try to acquire/keep the Floating IP (as long as all of the URLs in FAILOVER_CHECK can be successfully fetched).
It runs as follows (once a minute):
FAILOVER_CHECK. If one or more of the checks don't succeed -> failstandby:When in standby mode, the script will only take control of the floating IP if the main server is deemed unhealthy (i.e. at least one of the URLs in FAILOVER_MAIN return with an error code)
It does the following (once a minute):
FAILOVER_CHECK (i.e. the health of the local service(s)). If one or more of the checks didn't succeed -> failFAILOVER_MAIN (to see if the main server is healthy). If it is -> successContent type
Image
Digest
Size
28.3 MB
Last updated
almost 9 years ago
docker pull mreithub/do-failover