Question

Load Balancer and Droplet synchronization

Hi, a beginner question on the load balancer. I read the documentation but some information escapes me.

I have 2 droplets in the private network (ubuntu 18.04):

  • one for the web server
  • one for mysql

I want them both to have a load balancer, so I’d buy 2.

Do I have to buy 2 identical droplets (same CPU, RAM, SSD)?

On both droplets the information changes continuously: do you have to manually synchronize the droplet and its “clone” in load balancing? If yes, how?

If I add a block storage volume to the first droplet to manage the “var / www” folder, do I need to add and sync a volume on the clone as well?


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.

Thanks Bobby, very clear.

If I want to create a complete failover for the web server droplet (classic Droplet with Plesk), what strategy do you recommend? Is there anything similar to the cluster we created for the database?

Hello,

I’ll try to answer your questions in order:

  • If you are going to be using just a standard round robin load balancing with the same weight and priority, I would recommend using identical droplets
  • If you mount your /var/www folder on a shared storage, then the two droplets would have the same files and you would not have to do the synchronization manually

That is pretty much it for the web servers. Just make sure that you have some kind of caching like redis to save your sessions in so that your users don’t loose their sessions everytime they are forwarded to a different droplet.

If you want to load balance your SQL servers as well, then things get a bit more challenging. You could try using standard master to master replication but be aware of dead locks… Or you could try using something like a Galera cluster instead. Here’s how to setup those:

Galera Cluster on Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-configure-a-galera-cluster-with-mariadb-on-ubuntu-18-04-servers

Galera Cluster on Centos 7: https://bobbyiliev.com/blog/galera-cluster-mariadb-10-1-on-centos-7-server

Hope that this helps!

Bobby