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):
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.
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:
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