Server1 <-> server2 setup?

Hey, I am running a database and webserver, on one cloud instance (server1).

However I want to have a running backup (server2), so if I need to restart or update server1, i want server2 to be live on my domain. I could change the DNS but that takes 24 hours to react - there must be a better way? Some sort of load balancing server in front of server1 and server2, where I can switch where the traffic should go to? What can you recommend of servers/software for this?


Show comments

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.


I could suggest using Haproxy as a load balancer. You could add your server1 and server2 to the pool and that way Haproxy would load balance the traffic to the two servers.

If you need to upgrade server1, you could remove it from the pool and the traffic would be forwarded to server2 only.

For more information you could take a look at this tutorial here:

Hope that this helps! Regards, Bobby