Server1 <-> server2 setup?

Posted November 25, 2019 9.8k views
Load Balancing

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?


1 comment

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.

Submit an Answer
1 answer


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!

by Mitchell Anicas
An introduction to basic load balancing concepts and terminology, using HAProxy, with some examples.