卸载系统自带的Chrony:
注意:一下都是root下操作
rpm -qa|grep -i chrony
rpm -e chrony-2.1.1-3.el7.centos.x86_64
下载ntp:
yum install ntp -y
配置NTP-Server端:
vi /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
restrict 10.***.***.*** mask 255.255.255.0 nomodify notrap
#允许内网其他机器同步时间
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server 127.127.1.0 #主机与自己时间校准
fudge 127.127.1.0 stratum 10 #找不到ntp服务也与自己校准
配置NTP-Client端:
vi /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server 10.***.***.*** #ntp主机地址 以10.***.***.***时间作为时间服务
restrict 10.***.***.*** nomodify notrap noquery #允许上层服务器修改本机时间
重启ntp
systemctl restart ntpd