You‘re supposed to host this yourself.
You‘re supposed to host this yourself.
Set the DNS cache time to 60 seconds.
Set the script to run on every host delayed by some time to avoid simultaneously accessing the API (e.g. run the script every other minute).
With this approach, you get automatic failover in at most 3 minutes.
I’d host it on both webservers. The script sets the A record to all the servers that are online. Obviously, the script als has to check it’s own service.
It seems a little hacky though, for a business use case I would use another approach.
OP said that they have a static website, this eliminates the need for session sync.
Your challenge is that you need a loadbalancer. By hosting the loadbalancer yourself (e.g. on a VPS), you could also host your websites directly there…
My approach would be DNS-based. You can have multiple DNS A records, and the client picks one of them. With a little script you could remove one of the A Records of that server goes down. This way, you wouldn’t need a central hardware.
No, with these reasons:
I have a VPS for these tasks, and I host a few sites for friends amd family.
I like it :) Can you provide a link to the sensors you used?