Discussion:
using haproxy.socket to add new servers.
Kevin Hunt, Ph.D
2014-08-06 15:24:30 UTC
Permalink
Is this supported? I want to do this when we dynamically add servers in EC2, but I cant find documentation if its really an option with haproxy.
haproxy_add_remove.txt<https://gist.github.com/toddlers/6080314#file-haproxy_add_remove-txt>
Raw<https://gist.github.com/toddlers/6080314/raw/8f2f59d46279a5397cf4890d6737ba366ddda677/haproxy_add_remove.txt>
12345


Adding a serverA ipA:portA to the 'query_backend':

echo "add server query_backend/serverA ipA:portA check inter 3000 rise 2 fall 3 maxconn 50" | socat stdio unix-connect:/var/haproxy.socket



Removing serverA again:

echo "remove server query_backend/serverA" | socat stdio unix-connect:/var/haproxy.socket

Extracted from: https://gist.github.com/toddlers/6080314
------------------------------------
Dr. Kevin H. Hunt - TransWorks
AVP of Infrastructure
Security Officer
dr.kevin.hunt-9QToPCSl4a5Wk0Htik3J/***@public.gmane.org
260-487-4610
260-487-4440 Fax
Steven Le Roux
2014-08-07 09:05:48 UTC
Permalink
Hi,

no you can't for now.

But what you could do is to add dummy servers (for provisionning) with
dummy addresses that will not match any checks, and then when you have a
new server available as backend, and just change the address by the new one
from the CLI.

According to willy it was on the way, I don't know if it has been pushed
yet. This is a feature that is part of the health-checks ability to watch
for a dns change.

If it's not already done, maybe you could try to contribute it ?
Post by Kevin Hunt, Ph.D
Is this supported? I want to do this when we dynamically add servers in
EC2, but I cant find documentation if its really an option with haproxy.
*haproxy_add_remove.txt*
<https://gist.github.com/toddlers/6080314#file-haproxy_add_remove-txt>
*Raw*
<https://gist.github.com/toddlers/6080314/raw/8f2f59d46279a5397cf4890d6737ba366ddda677/haproxy_add_remove.txt>
12345
echo "add server query_backend/serverA ipA:portA check inter 3000 rise 2 fall 3 maxconn 50" | socat stdio unix-connect:/var/haproxy.socket
echo "remove server query_backend/serverA" | socat stdio unix-connect:/var/haproxy.socket
Extracted from: https://gist.github.com/toddlers/6080314
------------------------------------
Dr. Kevin H. Hunt - TransWorks
AVP of Infrastructure
Security Officer
260-487-4610
260-487-4440 Fax
--
Steven Le Roux
Jabber-ID : Steven-gLC+hB8UoVdQFI55V6+***@public.gmane.org
0x39494CCB <steven-***@public.gmane.org>
2FF7 226B 552E 4709 03F0 6281 72D7 A010 3949 4CCB
Loading...