I’ve got a simple setup. Three total Ubuntu 16.04 nodes – two devoted for webservers and one for a load balancer. I’m trying to set up the load balancer, but I’m not sure how or where to start. I noticed that there is a chef provisioning resource, but the documentation (https://docs.chef.io/resource_load_balancer.html) doesn’t seem to include any examples.
Is this a good place to start? Or should I go down the path of configuring my own load balancer? I’m going for the simplest/easiest option.
Hi,
The load balancer resource is part of chef provisioning. It literally manages load balancer (ELB) for example on AWS or similar. This is not what you’re looking for specifically.
For your problem at hand you would need to know
how to balance your web server in general (you need to know this)…
break down the pieces needed to do so (maybe nginx?)
automate the installation and configuration of each piece (nginx and a config for it)
once those are known you can proceed with automating a load balancer that works for your needs
there may be some generic chef / community cookbooks out there that do something basic… but even then you need to know what YOU need specifically…
Thanks for the reply I’ll look into it. Round-robin is good enough for me. Sounds like there isn’t any pre-existing recipe on chef to solve my little simple scenario. I’ll try to whip something up using calls to nginx (like you said) or something like it.
Well load balancer uses cases are usually handled with HA-Proxy. And as everyone has different expectetation from a reverse proxy/load-balancer, there’s few chance someone use case would fit someone else one, hence why there’s no existing shared recipes, it would only be useful to a few people.
First, be a bit more specific. Ultimately, you aren’t configuring “a load balancer”. You are configuring Ubuntu and some packages, and the end result will hopefully be a system that does load balancing.
What mechanisms and packages are you using as a load balancer? nginx? Or are you using DNS for round-robin load balancing?
Look for cookbooks that help you configure the selected package.
Basically, chef doesn’t relieve you from the hard decisions: designing how to accomplish your goal. Arguably, you actually have to do more detailed planning than if you tweak configuration files manually. Chef just helps you deal with the grunt work of fiddling with configuration files, and ensuring that the configuration doesn’t get messed up.