[ntp:questions] Tricking NTP's driftfile

J. Cochran jdc at smof.fiawol.org
Tue Jun 24 18:16:57 UTC 2008


In article <1214259078.48601f86a06d7 at webmail.vt.edu>,
Steven <sed_facebook at vt.edu> wrote:
>System Information:
>-------------------
>At work, I am configuring a system which consists of six servers (master,
>slave1, ... slave5) networked together but kept isolated from any external
>network.
>
>The ONLY time requirement is that all the systems have the same time,
>which does NOT need to be accurate, just consistent.
>
>All servers run RHEL4 and use ntp-4.2.0.a.20040617-6.el4.
>
>All systems: (all files owned by root unless specified)
>  /etc/ntp.conf 644
>    server 127.127.1.0
>    server master # LINE NOT INCLUDED ON master
>    driftfile /var/lib/ntp/drift
>    broadcastdelay 0.08
>
> /etc/ntp           755
> /etc/ntp/keys      600: Only commented lines
> /etc/ntpservers    644: Default (redhat time servers)
> /etc/step-tickers  644: slave: master, master: empty
> /var/lib/ntp/drift 644 (ntp:ntp): 0.0
>
>Problem:
>--------
>While the master goes through its synchronization routine (~10 mins), the slaves
>cannot obtain the time (see below).  Even after the master is responsive, the
>drift file is not written to.
>[root at slave1 ~]# ntpdate -d master
>...
>192.168.1.1: Server dropped: strata too high
>...
>23 Jun 17:28:33 ntpdate [3343]: no server suitable for synchronization found
>
>Question:
>---------
>I have tried adjusting the driftfile manually, and /var/log/messages shows the
>following:
>frequency initialized 0.001 PPM from /var/lib/ntp/drift
>
>However, the synchronization routine still runs.
>
>How do I 'trick' ntpd into thinking it has already performed the synchronization
>therefore not completing the routine?

You can't "trick" the server into not doing it's initial startup synchronization
and the presence of a drift file simply gives NTP a starting point so that if
you have an external time reference it will converge to that reference sooner.

However, what you can do is significatly reduce the amount of time that NTP
will take before it considers itself to be synchronized.

I'd recommend replacing the following line on your master

server 127.127.1.0

with these 2 lines:

server 127.127.1.0 minpoll 4 maxpoll 10
fudge  127.127.1.1 stratum 10

This will cause the NTP server to check itself every 16 seconds
instead of the default 64 seconds. And then for the slave servers,
I'd suggest that

server 127.127.1.0

Also be replaced with 

server 127.127.1.0
fudge  127.127.1.1 stratum 12

If you want, you could also use the minpoll and maxpoll options on the slaves
as well. The importaint difference is upping the stratum 2 levels above
what the master is set to.




More information about the questions mailing list