1、 安装
yum -y install chrony #默认系统已安装
2、 启动自启
systemctl enable --now chronyd
3、 添加同步时间服务器
vim /etc/chrony.conf
ntp.aliyun.com
#保存重启chronyd
systemctl restart chronyd
4、 查看网络同步时间是否开启
timedatectl
5、还有一个关键的信息,就是服务器的时区是必须设成 Asia/Shanghai 亚洲/上海时区
查看时区:timedatectl
设置时区:timedatectl set-timezone Asia/Shanghai
查看所有时区:timedatectl list-timezones
5、 chrony服务是缓慢进行时间同步,如果需要直接同步,使用:chronyc waitsync