when chrony sync time wtih local,why the Last Sample is not zero

Posted on

Problem :

Linux version: Centos 7

chrony version: 3.2


driftfile /var/lib/chrony/drift
local stratum 10
server localhost
makestep 1.0 3
logdir /var/log/chrony

This picture is about chrony:

chronyc sources -v

This picture is about ntpd, why they are different:

ntpq -p

Solution :

The offset printed by chronyc sources is not zero, because it’s an actual NTP measurement. chronyd sent an NTP request to itself and responded. As the delays of the messages were not perfectly symmetric, there is a non-zero offset. Trying to synchronize a client to itself is not a good idea as it may create a positive feedback loop and throw the clock off. The local stratum directive alone is enough to serve the local time when not synchronized to a time source.

The LOCAL source printed by ntpq is different. It is specified in ntp.conf as Addresses in the network are special addresses for ntpd. They specify reference clocks and the LOCAL reference clock driver always returns zero offset. While it looks like a valid IPv4 address of localhost, there are no NTP packets actually exchanged.

Leave a Reply

Your email address will not be published. Required fields are marked *