Alex, I think the following would be a good read: http://dasunhegoda.com/how-to-setup-haproxy-with-keepalived/833/
-- John Skarbek On February 18, 2016 at 12:20:15, [email protected] ([email protected]<mailto:[email protected]>) wrote: Thank you Mehdi and John for replying. It looks like the simplest, but perhaps not the greatest, way of doing this is simply calling something like sudo service haproxy reload which results in the same command being issued as shown in the sample script. Having backup servers and controlling them via haproxy console is also an option of course, that was my first thought but THEY wanted us to test adding brand new servers :) And finally, we are pretty new to this, so references to more advanced topics are confusing. John, could you share a sample of how do you configure to HAProxys and flip between them? Regards, Alex ________________________________ From: "Skarbek, John" <[email protected]> To: "[email protected]" <[email protected]>; Mehdi Ahmadi <[email protected]> Cc: HAproxy Mailing Lists <[email protected]> Sent: Thursday, February 18, 2016 9:44 AM Subject: Re: config changes on the fly -- dynamically adding/removing backend servers Tying into Mehdi, I’ll share with you what we do at our organization which works pretty well. For one, we have two haproxy servers that run keepalived. That way if we need to do something invasive we have a backup to handle the traffic. The process to flip to that server has minimal impact and more could be done to lower that. Secondly a method of using reload for your server configuration would also benefit greatly to assist with this. Gracefully reloading haproxy would allow one to handle on-going connections until they end, and bring online the new server gracefully with minimal impact. Here’s an example haproxy init script<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.haproxy.org_download_contrib_haproxy.init.el5&d=CwMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=ezX-PvLwd0Cwl5wQQDNm_u13VABhpBBVbEU30qplZ0E&s=rUU_poxeLIEcEeVcgmefojjmuzAZj_JAp7tv6MiKaAk&e=> that supports reload. Haproxy does not automatically reread his configuration file without some sort of signal being sent to him. Even other solutions used by some other services use the above approach to dynamically configure haproxy appropriately. -- John Skarbek On February 18, 2016 at 09:25:54, Mehdi Ahmadi ([email protected]<mailto:[email protected]>) wrote: A `restart` - is naturally an unconditional step thats required - especially in cases of new backends or server additions therein - which are not trivial changes. Network loss / disturbance - if any - is negligible as any existing connections should be migrated between process with a minute window (relative to host) where new connection may not get a response, etc - though realistically in most modern x64 hosts and environments we're talking of < 10ms (least in my own case). What may be a better option for you to consider is - having backup server instances / routes predefined that you can then adjust or change dynamically and perhaps even better control via `acl` related clauses which can also be changed dynamically without having to do a restart. This procedure can also work for load elastication - for example where you'd have at least 100% / duplicate number of server instances in each backend; also a similar approach may server for later fail-safes that have not yet been spawned or running but at least have a predefined route which can be adjusted with appropriate checks and server weighting without any further restart. I hope I've not misinformed you in anyway. On Thu, Feb 18, 2016 at 3:07 PM, <[email protected]<mailto:[email protected]>> wrote: Hello, What is the best way to dynamically add a new backend server (cluster node) without causing traffic disruptions? In other words, after adding a new 'server' line to backend section. Merely saving the configuration file does not seem to cause HAProxy to re-read the configuration. My HAProxy runs as a service. Thank you Alex

