chrony 文档警告
警告:某些软件会受到系统时间中此类跳跃的严重影响。(这就是 chronyd 正常使用回转的原因。)文档
但是文档没有给出示例。将受到严重影响的软件示例有哪些?操作系统或任何后台进程是否存在风险?
我有两个联网的 voxls,我正在尝试使用 chrony 进行同步。voxls 以截然不同的系统时间启动,就像相隔数年一样。我希望 chrony 在服务开始使用时同步时间makestep
,但在启动 chrony 后,我仍然观察到系统时间有很大差异。
配置如下:
#server 10.0.0.102
makestep 1.0 3
driftfile /var/lib/chrony/drift
rtcsync
allow 10.0.0
local stratum 8
manual
logdir /var/log/chrony
#client 10.0.0.101
server 10.0.0.102 iburst maxpoll 5 prefer
makestep 1.0 3
driftfile /var/lib/chrony/drift
rtcsync
logdir /var/log/chrony
当 chrony 启动时,我希望它能makestep
一口气同步客户端,我看到 systemclt 状态中的时间调整
root@voxl1:~# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-01 21:34:52 UTC; 83 years 0 months ago
Process: 3086 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 3088 (chronyd)
CGroup: /system.slice/chronyd.service
└─3088 /usr/sbin/chronyd
Feb 01 21:34:52 voxl1 systemd[1]: Starting NTP client/server...
Feb 01 21:34:52 voxl1 chronyd[3088]: chronyd version 2.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -...EBUG)
Feb 01 21:34:52 voxl1 chronyd[3088]: Frequency -0.681 +/- 0.232 ppm read from /var/lib/chrony/drift
Feb 01 21:34:52 voxl1 systemd[1]: Started NTP client/server.
Feb 01 21:34:56 voxl1 chronyd[3088]: Selected source 10.0.0.102
Feb 01 21:34:56 voxl1 chronyd[3088]: System clock wrong by 2619696428.415401 seconds, adjustment started
Feb 07 11:02:04 voxl1 chronyd[3088]: System clock was stepped by 2619696428.415401 seconds
如果我使用chronyc tracking
orchronyc sources
观察时间偏移,报告表明时间在 100 微秒内同步。
root@voxl1:~# chronyc tracking
Reference ID : 10.0.0.102 (10.0.0.102)
Stratum : 9
Ref time (UTC) : Sun Feb 07 11:08:34 2106
System time : 0.000066503 seconds slow of NTP time
Last offset : -0.000076736 seconds
RMS offset : 0.000044063 seconds
Frequency : 0.785 ppm slow
Residual freq : -0.216 ppm
Skew : 0.987 ppm
Root delay : 0.004293 seconds
Root dispersion : 0.000069 seconds
Update interval : 129.8 seconds
Leap status : Normal
root@voxl1:~# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 10.0.0.102 8 6 377 46 -77us[ -109us] +/- 1953us
但是,如果我然后打印日期,它根本不匹配时间服务器。
客户端 10.0.0.101
root@voxl1:~# date
Sun Feb 7 11:12:00 UTC 2106
服务器 10.0.0.102
root@voxl2:~# date
Thu Jan 1 04:43:02 UTC 1970
然后我试图触发一个手册chronyc makestep
,但这似乎也没有效果。
为什么我的日期不一样?makestep 是否按预期工作?chronyc makestep
时钟走多远有限制吗?
编辑:我有一个假设,但我不知道如何检验它。我想我可能会看到下溢错误。1970 年 1 月 1 日是 Unix 纪元。我的假设是当 chrony 第一次尝试在启动时同步客户端时,它会产生下溢错误,我看到了 systemctl 消息
Feb 01 21:34:56 voxl1 chronyd[3088]: System clock wrong by 2619696428.415401 seconds, adjustment started
Feb 07 11:02:04 voxl1 chronyd[3088]: System clock was stepped by 2619696428.415401 seconds
那个不正确的步骤将客户端推送到 2106,chrony 现在认为它与服务器同步,这就是为什么进一步的 makesteps 没有效果并且偏移量看起来很小的原因。
任何想法如何检验这个假设?