CentOS6.5 ntp伺服器不同步問題解決
[root@nagios ~]# ntpdate 10.1.0.1 n 9 May 11:11:21 ntpdate[1508]: no server suitable for synchronization foundn
解決方法:
在ntp伺服器上操作:
[root@install201 ~]# watch ntpq -p //檢測ntpq -p的運行結果n
可以發現本伺服器不能與配置文件中設置的時間伺服器同步,可修改配置文件,另其不能與其他server同步時,可與其自身保持同步。
[root@install201 ~]# vi /etc/ntp.confn# For more information about this file, see the man pages n# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).nndriftfile /var/lib/ntp/driftnn# Permit time synchronization with our time source, but do notn# permit the source to query or modify the service on this system.nrestrict default kod nomodify notrap nopeer noquerynrestrict -6 default kod nomodify notrap nopeer noquerynn# Permit all access over the loopback interface. This couldn# be tightened as well, but to do so would effect some ofn# the administrative functions.nrestrict 127.0.0.1 nrestrict -6 ::1nn# Hosts on local network are less restricted.nrestrict 192.168.1.0 mask 255.255.255.0 nomodify notrapnrestrict 10.0.0.0 mask 255.255.255.0 nomodify notrapnn# Use public servers from the pool.ntp.org project.n# Please consider joining the pool (http://www.pool.ntp.org/join.html).nserver 0.centos.pool.ntp.org iburstnserver 1.centos.pool.ntp.org iburstnserver 2.centos.pool.ntp.org iburstnserver 3.centos.pool.ntp.org iburstnn# 指定階層編號為10,降低其優先度。當伺服器與公用的時間伺服器失去聯繫時以本地時間為客戶端提供時間服務n# 這次添加的是這裡nserver 127.127.1.0 # local clocknfudge 127.127.1.0 stratum 10n# 添加結束nn#broadcast 192.168.1.255 autokey # broadcast servern#broadcastclient # broadcast clientn#broadcast 224.0.1.1 autokey # multicast servern#multicastclient 224.0.1.1 # multicast clientn#manycastserver 239.255.254.254 # manycast servern#manycastclient 239.255.254.254 autokey # manycast clientnn# Enable public key cryptography.n#cryptonnincludefile /etc/ntp/crypto/pwnn# Key file containing the keys and key identifiers used when operatingn# with symmetric key cryptography. nkeys /etc/ntp/keysnn# Specify the key identifiers which are trusted.n#trustedkey 4 8 42nnn# Specify the key identifier to use with the ntpdc utility.n#requestkey 8nn# Specify the key identifier to use with the ntpq utility.n#controlkey 8nn# Enable writing of statistics records.n#statistics clockstats cryptostats loopstats peerstatsnlogfile /var/log/ntp.lognnBroadcastdelay 0.008 n/etc/ntp.conf n
重啟ntp服務,待5-8分鐘後,再觀察時間同步情況:
[root@install201 ~]# /etc/init.d/ntpd restartn關閉 ntpd: [確定]n正在啟動 ntpd: [確定]n[root@install201 ~]# watch ntpq -pnEvery 2.0s: ntpq -p Tue May 9 11:23:42 2017nn remote refid st t when poll reach delay offset jittern==============================================================================n*LOCAL(0) .LOCL. 10 l 18 64 3 0.000 0.000 0.000nn[root@nagios ~]# ntpdate 10.1.0.1n 9 May 11:37:01 ntpdate[1633]: adjust time server 10.1.0.1 offset 0.014875 secn
推薦閱讀:
※期末考試在即,教你怎樣答題,才得到閱卷老師的青睞!
※同步提分|停課後,這封特別的告家長書,引發所有家長的深思
※有人用漢語翻譯了一首英文詩,全世界都服了
※同步提分|在外國朋友眼裡,中國名人英語最好的竟然是她?!