# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# NTP服务器地址。server可以配置多个,这里配了阿里云、腾讯云、一个私人ntp和中科院的ntp服务器,实际测试中中科院的ntp服务器最慢
server ntp.aliyun.com iburst
server ntp1.aliyun.com iburst
server time1.cloud.tencent.com iburst
server time3.cloud.tencent.com iburst
server cn.ntp.org.cn iburst
server ntp.ntsc.ac.cn iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
# 允许连接到此服务器同步时间的网段;0.0.0.0/0表示允许所有网段;注释该配置此服务就只能作为NTP客户端,不能作为服务器
allow 0.0.0.0/0
# Serve time even if not synchronized to a time source.
# 当配置的server不可用时,是否使用本地时间同步到客户端
local stratum 10
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# Get TAI-UTC offset and leap seconds from the system tz database.
#leapsectz right/UTC
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
#log measurements statistics tracking
#和服务器相差多少秒内才执行同步。本地时间和服务器时间相差的秒数超过这个时间就不会同步。默认是3秒
maxdistance 94608000.0