chronyd 通过配置的 ntp-server 来调整主机的时间,可以通过配置 initstepslew、maxupdateskew 等参数来配置误差范围来控制调整的幅度,避免远程 ntp-server 误差影响自己。
Ref chrony.conf(5)
chronyc -a makestep
chronyd -q 'server 192.168.11.145 iburst'
chronyc sources -v
结果例:
.-- 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 =============================================================================== ^* ..................... 11 10 377 530 -654ns[ -905ns] +/- 477ms
通常 MS 值为 ^*
对应 server, current synced。如果 source state 是 ?
说明源不可用。