Report this

What is the reason for this report?

Server1 <-> server2 setup?

Posted on November 25, 2019

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?

Thanks



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!

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.

Hello,

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:

https://www.digitalocean.com/community/tutorials/an-introduction-to-haproxy-and-load-balancing-concepts

Hope that this helps! Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.