master
vim /etc/ntp.conf
修改现有的为
#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 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 8
systemctl enable ntpd;systemctl start ntpd
ntpq -p,看到local代表为NTP server
别的节点修改为
#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 masterip iburst
systemctl enable ntpd;systemctl start ntpd
ntpq -p,看到目标地址代表配置正确