Server1 <-> server2 setup?

November 25, 2019 142 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?

Thanks

1 comment
1 Answer

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

by Mitchell Anicas
An introduction to basic load balancing concepts and terminology, using HAProxy, with some examples.
Have another answer? Share your knowledge.

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