Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.63 KB

chrony.org

File metadata and controls

42 lines (34 loc) · 1.63 KB

chrony

chronyd 通过配置的 ntp-server 来调整主机的时间,可以通过配置 initstepslew、maxupdateskew 等参数来配置误差范围来控制调整的幅度,避免远程 ntp-server 误差影响自己。

Ref chrony.conf(5)

手动同步

chronyc -a makestep

检查 ntp 服务器

chronyd -q 'server 192.168.11.145 iburst'

查看 ntp 源状态

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 是 ? 说明源不可用。