程序部署
yum install -y ntp ntpdate
systemctl start ntpd
systemctl enable ntpd
主节点修改
修改/etc/ntpd.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
restrict 192.168.1.0 mask 255.255.255.0 nomodify
server 127.127.1.0
fudge 127.127.1.0 stratum 10
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
启动服务
systemctl start ntpd
timedatectl set-ntp yes
timedatectl(命令可以查看到NTP enabled:yes)
ntpq -np 可以查看到remote为 127.127.1.0