2

I've been searching for a way to add and remove backend servers from HAProxy dinamically, is there a wrapper or even an API to handle it? I want to make an auto-scale system with HAProxy and DigitalOCean. Others load-balancers are welcome.

3 Answers 3

2

There is no API or anyway to do what you want. You need to add the backends into the config and do a graceful reload.

What that does is it spins off another haproxy process to handle the traffic and the other process waits till it finishes and quits. You should be able to reload haproxy with no connection refused or bad requests.

4
  • So, you mean I need change the config file and make a reload? Theres no way to interact with HAProxy by command line?
    – Pedrommone
    Nov 24, 2014 at 15:05
  • not to add a backend.. you can only put take them out like put them into maintenance mode once added
    – Mike
    Nov 24, 2014 at 16:59
  • But, I want to add new endpoints, not a "backend section"
    – Pedrommone
    Nov 25, 2014 at 11:08
  • can't do that via the socket api either
    – Mike
    Nov 25, 2014 at 13:30
1

Since this question appear in search result, I'd like to put updated reference here.

This is an article by HAproxy that answer the question above.

HAProxy dynamic scaling runtime API

0

You shouldn't need to. HAProxy won't balance to a backend without a good healthcheck so just add extra ones. Also you can control server weights.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .