How to setup a backup for 2 VPSs in 2 DCs? Do I need a load balancer? What about Failover IP?

August 4, 2017 126 views
Load Balancing Backups DigitalOcean Networking DNS

what is the best solution when I want 2 servers in 2 separated DCs. The main one in EU, second one in US. The second one should same like the main one or at least the DB should be copied from the main one every X minutes.

In case of problem with the main server/DC SOMETHING should automatically switch the trafic to the second one without any problems. Do I need a load balancer? What about Failover IP?

What would you suggest me?

1 Answer

Hi @petrvacha

Currently DigitalOcean doesn't provide services like Load Balancer or Floating IP to go between multiple data centers. They're provided in the data center where they're created.

If you want something with relatively fail-over, you should setup your database with something like Galera or in Master-Master.
That way, you would have your database in multiple locations - in real-time sync.
Then you should use a DNS with a low TTL (less than 5 minutes).
You should then setup the secondary server to monitor the primary server. In case the secondary site cannot contact the primary site, then the secondary site would change the DNS so it became the primary site. When the original primary site comes online again, then it should be promoted to the primary site in DNS.

Doing high availability isn't 1-2-3-simple and takes some planning, while trying to think of every scenario that could go wrong and mitigate against that.

Have another answer? Share your knowledge.