Blog calendar
— or —
michal-frackowiakSquark
shark797039
Arotaritei Vlad
Alokranjan
Refutnik
TRT- Vipul Sharma
yerihyo
Matt Gentile
Hirelawyer
Helmut_pdorf
Sven Stettner
michalf23
leiger
srivercx
Brian Pas
Joshua Darby
lil g easy
Mr Shaggy
Chen XX
... and more
Blog tags
Welcome to my blog — place for ideas, comments, interesting hacks and boring personal stuff. Enjoy!
HAProxy and Chef - dynamic backend server list
20 Nov 2014 10:02
After the recent load balancer upgrade at Wikidot people asked me about the magic behind automatic HAProxy configuration — namely, how do we solve dynamical addition and removal of backend servers. It's not that complex, we use Chef.
Below I will tell you how we do it.
Assumptions:
- We have a working Chef server.
- All nodes run Ubuntu, but it's not really important.
- All nodes run chef-client periodically (in our case, every 3 minutes).
- All web nodes have role web.
As a result will develop a minimal haproxy cookbook to be run on the HAProxy node that:
- Will set up HAproxy service.
- Will discover and connect to all backend servers.
Tags: chef haproxy wikidot