分类: 云计算
2015-03-31 14:36:39
#ntpq -c peers remote refid st t when poll reach delay offset jitter ============================================================================== *ntp-server1 192.0.2.11 2 u 169 1024 377 1.901 -0.611 5.483 +ntp-server2 192.0.2.12 2 u 887 1024 377 0.922 -0.246 2.864
# ntpq -c assoc ind assid status conf reach auth condition last_event cnt =========================================================== 1 20487 961a yes yes none sys.peer sys_peer 1 2 20488 941a yes yes none candidate sys_peer 1
但是在执行上述第二个命令时会发现 reach和condition都会出现none.
这个时候可以考虑修改controller和compute1上/etc/ntp.conf
driftfile /var/lib/ntp/drift # Permit time synchronization with our time source, but do not # permit 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. server 127.127.1.0 fudge 127.127.1.0 stratum 8 restrict 127.0.0.1 restrict ::1 #restrict 10.0.0.31 restrict -4 default kod notrap nomodify restrict -6 default kod notrap nomodify # Hosts on local network are less restricted. restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
根据自己的fixed ip而定 # Use public servers from the pool.ntp.org project. # Please consider joining the pool (). #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 #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 # Enable public key cryptography. #crypto