Load balancing with puppet

Posted by Gonçalo Queirós on Server Fault See other posts from Server Fault or by Gonçalo Queirós
Published on 2010-05-25T20:29:10Z Indexed on 2010/05/25 20:33 UTC
Read the original article Hit count: 272

Filed under:
|

Hi there.

Im trying to setup a loadbalancing system. My load balancer (nginx) has a conf file where i should list all IP's of the upstream servers.

I could put the IP's on the conf manually, but this ways i would need to change the conf file every time i add/remove an upstream server.

For now i came up with two different ideas, but i don't like much of neither:

1 - Have every upstream machine to use Exported Resources to create a file with it's IP..Then the load balancer server will have an "include conf_directory/*", and load all the files created by the upstrem servers. Since the load balancer is using nginx this can be done, but if i wan't latter on to configure something that doesn't have the "include" on the conf files, this solution will not work.

2 - If the config doesn't support the "include" command, then we could have again, every upstream server use the Exported Resources to create a filw with its IP, and latter on, the load balancer execute a command that would pick every file and generate the config

Both versions addopt the same techinque, the difference is that version 2 is used when the server (that needs to have a conf generated) doesn't recognize a command like "include" inside its own conf.

Now, my question is, is there any way to do this in a different form? I suspect that there is, since puppet is made to manage multiple servers, it seems a bit strange not have a easy way to configure load balancers.

© Server Fault or respective owner

Related posts about load-balancing

Related posts about puppet