Chrony时间同步服务
Chronyd是一个[[开源]]的时间服务,用于自动同步linux服务器时间 服务端口: UDP 323
安装:
yum install -y chrony
systemctl enable chronyd
systemctl start chronyd配置文件:
vi /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# 指定本机要同步时间的服务器,每个一行
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# 记录系统时钟增/减时间的比例到指定文件,下次重启系统时按该比例做出最合适的调整。
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# chronyd根据需求减慢或加速时间调整,
# 在某些情况下系统时钟可能漂移过快,导致时间调整用时过长。
# 该指令强制chronyd调整时期,大于某个阀值时步进调整系统时钟。
# 只有在因chronyd启动时间超过指定的限制时(可使用负值来禁用限制)没有更多时钟更新时才生效。
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# 将启用一个内核模式,在该模式中,系统时间每11分钟会拷贝到实时时钟(RTC)。
# 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.
#allow 192.168.0.0/16
# Serve time even if not synchronized to a time source.
#local stratum 10
# Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
# 日志保存位置
# Specify directory for log files.
logdir /var/log/chrony
# Select which information is logged.
# log measurements statistics tracking最后更新于