Load Balancer and Droplet synchronization

Posted July 3, 2019 5k views
DigitalOceanLoad BalancingUbuntu 18.04

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?

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
2 answers


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:

Galera Cluster on Centos 7:

Hope that this helps!


by bsder
In this guide, you will configure an active-active MariaDB Galera cluster. For demonstration purposes, you will configure and test three Ubuntu 18.04 Droplets that will act as nodes in the cluster. MariaDB is an open source relational database system that is fully compatible with the popular MySQL RDBMS system. Galera is a database clustering solution that enables you to set up multi-master clusters using synchronous replication.

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?

  • Hey,

    Usually with a plain server running only let’s say Apache and PHP you could just use a shared storage or a service like Lsyncd to sync your files.

    However with a control panel things get a bit more complicated as there are a lot of other services and automated tasks involved. But as far as I can see with Plesk there is a multi-server setup that you could try:

    I’ve not personally used it but their documentation seems OK.