[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ntp-server doesn't sync time correctly?



Cameron G wrote:
I have a handful of debian servers going, and I've done an apt-get install
ntp-server on all of them. They all seem to have "server pool.ntp.org" in
the config file, yet they're all out of sync a little bit, by a couple of
minutes in some cases.

This could be because the server you're syncing to are out of sync. pool.ntp.org is just a DNS alias to people who are kind enough to offer free ntp syncing to others so as to lessen the load on the upper tiers of the NTP network.

Best thing to do is change pool.ntp.org to [region].pool.ntp.org where [region] is the region of the world you're in. For me that's north-america. This will ensure you get a server physically close to you and reduce the lag between you and the server. Second you might want to add 3 different servers like this:
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org

This will poll 3 different servers. If any of the three are wildly out of sync with the other two it will discard that server's input and go with the other two.

Finally, ensure that ntpd is running by using the command 'ntpq -p'. That will give you a list of peers that you're polling, their offset from your clock, how much their offset has changed over time and so on. Here's an example run:

{grey@teleute:/etc} ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*66.111.46.200   198.30.92.2      2 u  725 1024  377   68.180    0.440   0.204
+turnstile.ispl. 216.218.192.202  2 u  290 1024  377   68.881    2.457  11.926
+schlitt.net     129.7.1.66       2 u  229 1024  377   88.844  -13.224   9.555

Also something to consider is syncing only one machine with ntpd to pool.ntp.org and sync the rest of your machines to that master machine. I run 4 machines here on my local network. 3 Debian, 1 Win2k. The Debian machine that acts as the NAT gateway for the other 3 syncs to pool.ntp.org. The above ntpq run is from that machine. The other 3 machines sync to the gateway. This is to ensure each machine is close to the other in terms of time and to lessen the load on pool.ntp.org itself. No reason for 12 connections into the pool when 3 will suffice, no? :)

--
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: