1、Server端配置chrony
yum install chrony -y #centos7默认采用chrony,一般不用再装
vim /etc/chrony.conf
修改下面2行
server ntp.aliyun.com iburst
allow 192.168.10.0/24
systemctl restart chronyd
systemctl enable chronyd
2、Client配置
yum install chrony -y
vim /etc/chrony.conf
#修改成server的ip或者主机名
server 192.168.10.41 iburst
systemctl restart chronyd
systemctl enable chronyd
chronyc sources
clock -w