节点1上的配置:
more /etc/ntp.conf
restrict default ignore
restrict 192.168.0.0 mask 255.255.255.0 notrap nomodify
server 162.105.129.27 # 互联网上的时间服务器
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
节点2上的配置:
more /etc/ntp.conf
restrict default ignore
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.255.0 nomodify
server 192.168.0.125 # 以节点1作为上级时间服务器
restrict 192.168.0.125
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
在两个节点上分别运行:
service ntpd start
chkconfig --level 35 ntpd on
--转自