[ntp:questions] NTP in a Linux cluster

Dave Hart davehart at gmail.com
Mon Sep 7 20:59:44 UTC 2009


The problem you have to deal with is ntpd is much more likely to
wiggle around a bit syncing over a WAN compared to over a LAN.  The
easiest way to ensure all the nodes stay tightly synced would be to
have a single box configured with 4 or more external servers you
trust, and have all the other machines sync to it.  Even better would
be to have 4 boxes each configured with 4 external sources (possibly
the same set on each, but that's not important as long as they're all
reasonably trustworthy), and have those 4 boxes each list the other
three as peers.  The remaining machines would then each be configured
with the 4 local boxes as their sources using server directives in
ntp.conf, probably with maxpoll 6.

If you wonder where all these "4 or more" come from, it's because with
two servers, ntpd has no idea which to trust if they diverge, while
with 3, two can outvote an apparent "falseticker".  But then with 3,
if any one of them goes down for maintenance, you're back to
freewheeling if the two remaining don't agree closely enough.

Given your design and your preference for using the same configuration
on each machine, it's probably worthwhile to try as you suggest and
have all the machines peer with each other.  I don't agree with
Richard's assessment that this will cause problems.  Then you could
use an identical configuration file across the cluster, listing 4 or
more WAN sources with "server" directives, and all the cluster members
with "peer" directives.  Each will ignore the request to peer with
itself in that case, and the peering should enable the whole cluster
to harmonize, particularly when there are more peers than external
sources.

An important point to understand is that ntpd doesn't simply attempt
to sync to the selected peer (* in the ntpq -p billboard), but instead
attempts to sync to the weighted average clock of all the survivors
(both * and + in the billboard).

Cheers,
Dave Hart




More information about the questions mailing list