Re: haproxy and changing ELB IPs

2018-08-07 Thread Patrick Hemmer


On 2018/8/7 05:45, Lukas Tribus wrote:
> Hello,
>
>
>> We recently had an outage for short time related to NameServer's h/w failure 
>> (both primary and secondary went down).
>> We were told that it is possible for these IPs to change in the future. It 
>> never happened so far though.
> So you don't have changing nameservers at all, but it is possible that
> the IPs will change once.
>
> I suggest you don't over-engineer this. Automating a possible one time
> occurrence is a waste of time, imho.
>
>
>> is it possible to optionally log the NS IPs during every health check?
> No.
>
>
>> Would a reload suffice instead of restart? It should not be difficult to 
>> create a monitor
>> for resolv.conf file using inotify lets say and automatically reload/restart 
>> haproxy in case
>> it's content has changed.
> Sure, a reload would suffice.
>
>
> Regards,
> Lukas
>
As an alternative option, if the system utilizes NetworkManager, then
solving this becomes very easy. NetworkManager can be configured to
provide a local dnsmasq instance as a DNS proxy. If this is enabled,
then your resolver becomes a static "127.0.0.1". And since
NetworkManager also integrates with the DHCP client, if the nameserver
IPs change, then it'll reload dnsmasq, and you don't need to do anything
with haproxy.
Enabling this is as simple as adding "dns = dnsmasq" to NetworkManager.conf.

-Patrick


Re: haproxy and changing ELB IPs

2018-08-07 Thread Lukas Tribus
Hello,


> We recently had an outage for short time related to NameServer's h/w failure 
> (both primary and secondary went down).
> We were told that it is possible for these IPs to change in the future. It 
> never happened so far though.

So you don't have changing nameservers at all, but it is possible that
the IPs will change once.

I suggest you don't over-engineer this. Automating a possible one time
occurrence is a waste of time, imho.


> is it possible to optionally log the NS IPs during every health check?

No.


> Would a reload suffice instead of restart? It should not be difficult to 
> create a monitor
> for resolv.conf file using inotify lets say and automatically reload/restart 
> haproxy in case
> it's content has changed.

Sure, a reload would suffice.


Regards,
Lukas