目录
前言
在Linux系统中,时间服务器确保系统时间的准确和一致性,这对于日志记录、安全性、调度任务等至关重要。通过NTP或Chrony等工具,系统可以定期与可信的时间源同步,避免时间差异导致的数据不一致和调试困难,特别在分布式系统中尤为重要。
一、Chrony安装
#sudo yum -y install chrony
二、服务配置
#vi /etc/chrony.conf
pool pool.ntp.org iburst #配置ntp服务器地址
# 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 o