New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Failover techniques?
Hi, i have an online app hosted in a VPS. I want to make a failover solution to have the app online as much as possible. I know about dns failover but i don't really like it because of the cache and other reasons. What do you use? I am looking for ideas. Thank you.
PS: I have no physical access to my VPS and i can buy other servers/services if needed.
Comments
Give us more information about your app/website.
I have a SaaS solution for some clients. It uses apache and mariadb. Nothing complicated.
IP anycast failover is a good option.
Get a separate VM. Replicate your database & website files to the 2nd VM. Use the 2nd VM to monitor your website. If the website is down or has any errors, the 2nd VM changes the A record of your website to the 2nd VM.
I recommend editing the files on the 2nd VM a bit with a big message that says the primary server is down. Put it in read-only mode or a message that says all messages / settings / posts will not be saved.
To acheive this, I have my own monitoring script (uses 3 VMs total to verify if the server is down) then if it is, I call Cloudflare's API to change the A record of my website. It'll send me an email notification that this happened. Alternatively, you can use something like uptime robot to do it for you. Here's some code that you might find useful - https://github.com/blackdotsh/UptimeFlare
Setup a Percona cluster. It should be a drop-in replacement for MySQL and provides multi-master replication using the Galera library. Alternately you can use DB as a service, and pay them to do it for you. Beyond the obvious choices like AWS and Google's Cloud SQL, I think BuyVM provides this as well.