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

Hi, 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?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.