客户端:
1.安装chrony。
bash
yum install chrony -y
systemctl start chronyd
systemctl enable chronyd
systemctl status chronyd
2.配置文件中注释掉自带服务器同步地址,添加服务器端配置的地址。
bash
#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。
bash
systemctl restart chronyd
timedatectl set-ntp true
4.查看时间源。
bash
chronyc sources -v
5.手动同步时间。
bash
chronyc -a makestep
6.显示状态。
bash
timedatectl