Linux /var/log/messages 偶尔会发生time reset +6.288863s
ntp
算法
combine algorithm
intersection algorithm
27 Jul 11:11:08 ntpd[100258]: 0.0.0.0 c515 05 clock_sync
27 Jul 11:13:41 ntpd[100258]: 0.0.0.0 0613 03 spike_detect +4.152511 s
27 Jul 11:27:01 ntpd[100258]: 0.0.0.0 061c 0c clock_step +4.151101 s
27 Jul 11:27:05 ntpd[100258]: 0.0.0.0 0614 04 freq_mode
log2:
Apr 6 16:39:01 AAA3 ntpd[2576]: synchronized to 172.16.100.81, stratum 3
Apr 6 16:56:16 AAA3 ntpd[2576]: time reset +6.288863 s
Apr 6 16:59:49 AAA3 ntpd[2576]: synchronized to 172.16.100.81, stratum 3
Resolution
When ntpd noticed the change in the clock, it step the clock, while stepping ntp resets almost everything i.e server trust etc.... The message is logged when the source selection doesn't have any selectable source (as ntp lose trust). After the clock step, ntp collects new samples for all sources, trust them again and reselect them.
time reset : The time error exceeds the step threshold and has been reset to the correct time.no_sys_peer: Indicates that there is no server that satisfies ntpd's stability criteria.
spike_detect : This is informational in that a difference between the local clock and the valid servers was temporarily greater than the 128ms max offset.
clock_step : Normally modifies the local system clock frequency to adjust for differences between it and the valid servers. If the offset is greater than 128ms, then unless configured otherwise, will step the system clock.
The drift file is /var/lib/ntp/ntp.drift. This is fairly standard. For RH/Fedora, it's /var/lib/ntp/drift.
The units for the drift file are "PPM", or "parts per million". Your clock will drift due to fluctuations in the frequency oscillating the quartz crystal on your motherboard. A fluctuation of just 0.001% (0.00001, or 10 PPM) means losing or gaining about 1 second per day. NTP has finer grained control than that, so we look at errors of margin using 0.0001% (0.000001, or 1 PPM). Thus:
1 PPM = 1 part per million = 1 microsecond per second = 3.6ms per hour = 86.4ms per day
Thus, my drift file shows the value of "2.643" which means my clock is off by 2.643 parts per million, which means it's currently off at 228.3552ms per day.
Reference
- [[https://askubuntu.com/questions/298007/what-units-does-the-ntp-drift-file-use][What units does the ntp drift file use?]]
- [[https://unix.stackexchange.com/questions/382067/whats-the-difference-between-clock-step-time-reset][whats-the-difference-between-clock-step-time-reset]]
- [[https://access.redhat.com/solutions/39194][access.redhat.com How to change the NTP Polling interval of NTP server or NTP client ?]]
- [[https://access.redhat.com/solutions/2328091][access.redhat.com Why after spike detect, most of the time ntp write 'no_sys_peer'?]]
- [[https://blog.birost.com/a?ID=01450-50d760d8-cddb-4099-8c9c-8095135478de][Why after spike detect, most of the time ntp write 'no_sys_peer'?]]
WARNING: No any other purpose,keeping reminded! So sorry to offended,if necessary, contact me and I do change what I had done to protect your privileges!