chrony同步时间间隔

通过搜索得知,chrony的同步间隔,在 /etc/chrony/chrony.conf 中可以设置

server hostname [option]…
The server directive specifies an NTP server which can be used as a time source. 
The client-server relationship is strictly hierarchical: a client might synchronise
its system time to that of the server, but the server’s system time will never be
influenced by that of a client.

This directive can be used multiple times to specify multiple servers.

The directive is immediately followed by either the name of the server, or its IP
address. It supports the following options:

minpoll poll
This option specifies the minimum interval between requests sent to the server as
a power of 2 in seconds. For example, minpoll 5 would mean that the polling interval
should not drop below 32 seconds. The default is 6 (64 seconds), the minimum is -6
(1/64th of a second), and the maximum is 24 (6 months). Note that intervals shorter
than 6 (64 seconds) should generally not be used with public servers on the Internet,
because it might be considered abuse. A sub-second interval will be enabled only when
the server is reachable and the round-trip delay is shorter than 10 milliseconds, 
i.e. the server should be in a local network.

maxpoll poll
This option specifies the maximum interval between requests sent to the server as a
power of 2 in seconds. For example, maxpoll 9 indicates that the polling interval
should stay at or below 9 (512 seconds). The default is 10 (1024 seconds), the minimum
is -6 (1/64th of a second), and the maximum is 24 (6 months).

ubuntu中的默认配置,没有使用 server 指令指定时间源,而是使用了 pool 指令

# This will use (up to):
# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
# sources will be used.
# At the same time it retains some protection against one of the entries being
# down (compare to just using one of the lines). See (LP: #1754358) for the
# discussion.
#
# About using servers from the NTP Pool Project in general see (LP: #104525).
# Approved by Ubuntu Technical Board on 2011-02-08.
# See http://www.pool.ntp.org/join.html for more information.
pool ntp.ubuntu.com        iburst maxsources 4
pool 0.ubuntu.pool.ntp.org iburst maxsources 1
pool 1.ubuntu.pool.ntp.org iburst maxsources 1
pool 2.ubuntu.pool.ntp.org iburst maxsources 2

所有的poll都没有设置minpoll 和 maxpoll,因此都是默认值 6和10,也就是同步间隔在 64~1024 秒。要查看每个源的同步状态输入命令
$ chronyc sources

其中的参数解释

Poll - This shows the rate at which the source is being polled, as a base-2 logarithm
of the interval in seconds. Thus, a value of 6 would indicate that a measurement is
being made every 64 seconds. chronyd automatically varies the polling rate in response
to prevailing conditions.

Reach - This shows the source’s reachability register printed as an octal number.
The register has 8 bits and is updated on every received or missed packet from the
source. A value of 377 indicates that a valid reply was received for all from the
last eight transmissions.

LastRx - This column shows how long ago the last sample was received from the source.
This is normally in seconds. The letters m, h, d or y indicate minutes, hours, days,
or years.

[From the chronyc Documentation](https://chrony.tuxfamily.org/doc/2.4/chronyc.html)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容