# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do notpermit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.17.10 nomodify notrap nopeer noquery #當(dāng)前節(jié)點(diǎn)ip地址
restrict 127.0.0.1
restrict ::1# Hosts on local network are less restricted.
#restrict 192.168.17.2mask 255.255.255.0 nomodify notrap #集群所在網(wǎng)段的網(wǎng)關(guān)(Gateway),子網(wǎng)掩碼(Genmask)
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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#選擇一個(gè)主節(jié)點(diǎn) 在server部分添加一下部分,
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
#主節(jié)點(diǎn)以外,在server部分添加如下語(yǔ)句,將server指向主節(jié)點(diǎn)。
server 192.168.17.10
Fudge 192.168.17.10 stratum 10#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
啟動(dòng)ntp systemctl start ntpd.service 或 service ntpd start 啟動(dòng) systemctl enable ntpd.service systemctl status ntpd.service 狀態(tài)