Centos8 配置时间同步

Centos8已经不支持NTP服务改用chrony服务

1.配置时间同步服务器地址

vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#pool 2.centos.pool.ntp.org iburst
server ntp.api.bz iburst
server ntp.aliyun.com iburst

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

#注释默认的时间同步服务器pool 2.centos.pool.ntp.org iburst,
#添加新的时间同步服务器server ntp.api.bz iburst server ntp.aliyun.com iburst

2.重启chrony服务,查看状态

systemctl restart chronyd
chronyc sources -v

syssss

timedatectl status

syss

3.设置chrony开机自启

systemctl enable chronyd

sys