[Dnsmasq-discuss] A (possibly bad) idea: failover in dnsmasq

Vincent Cadet v_cadet at yahoo.fr
Sat May 26 14:37:31 BST 2012

--- On Sat 26.5.12, Simon Kelley wrote :

Oops I had overlooked there is already such configuration :D Sorry for the noise.

> Need to wonder about security, since connections to the
> primary can mess with things.
> This only works with one primary and one secondary: if there
> are multiple secondaries they'll all become active when the
> primary dies, which is wrong.

As soon as a slave detects the master is down, it waits for a random delay (that must always be greater than the biggest latency) before probing the other living slaves, notifying it wants to become a master. Slaves which receive a notification cancel the process of becoming a master. The one slave that has received no notification (in a programmed duration that is common to all slaves and that should be greater than the highest latency) becomes the master; immediately after, it notifies the other slaves it is the master.

I guess every peer should be able to measure the latency between each of his living peers and send notifications to the fastest peer first, in order of increasing latency. To be significant the a mean latency value should be computed more or less like the load average.

The algorithm might even be generalized to become the default startup process. In this case, all you need to do is specify the list of peers and let the farm determine which will be the master. First come first served.

Does that make sense?

Best regards,

More information about the Dnsmasq-discuss mailing list