客户端:

1.安裝chrony。

yum install chrony -y
systemctl start chronyd
systemctl enable chronyd
systemctl status chronyd

2.配置文件中註釋掉自帶服務器同步地址,添加服務器端配置的地址。

#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
server 192.168.0.249 iburst

3.啓用NTP。

systemctl restart chronyd
timedatectl set-ntp true

4.查看時間源。

chronyc sources -v

5.手動同步時間。

chronyc -a makestep

6.顯示狀態。

timedatectl