1. 程式人生 > >ntpdate 同步時間錯誤no server suitable for synchronization found

ntpdate 同步時間錯誤no server suitable for synchronization found

在一臺centos最小化安裝的機器上面,yum -y install ntpdate安裝ntpdate同步時間。然而執行ntpdate -u ntp.sjtu.edu.cn的時候,死活調不了時間。並報以下錯誤

30 Oct 23:30:56 ntpdate[8200]: no server suitable for synchronization found


執行:ntpdate -d ntp.sjtu.edu.cn 命令除錯的時候,出現一下資訊:

30 Oct 23:26:54 ntpdate[8183]: ntpdate [email protected] Sat Nov 23 18:21:48 UTC 2013 (1)
Looking for host ntp.sjtu.edu.cn and service ntp
host found : 202.120.2.100
transmit(202.120.2.100)
transmit(202.120.2.100)
transmit(202.120.2.100)
transmit(202.120.2.100)
transmit(202.120.2.100)
202.120.2.100: Server dropped: no data
“......以下資訊略”

30 Oct 23:27:33 ntpdate[8183]: no server suitable for synchronization found


百度了幾遍,搜出來的東西都一個樣子的,複製來複制去。根本解決不了我的問題。無意中解決了這個問題。分享一下,供大家參考。


在外網另外一臺機器上面,同步時間正常,執行的ntpdate -d ntp.sjtu.edu.cn除錯,輸出以下除錯資訊

17 Dec 00:17:19 ntpdate[26682]: ntpdate [email protected] Tue May 31 10:09:22 UTC 2016 (1)
Looking for host cn.ntp.org.cn and service ntp
host found : time5.aliyun.com
transmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
server 182.92.12.11, port 123
stratum 2, precision -24, leap 00, trust 000
refid [182.92.12.11], delay 0.06557, dispersion 0.00020
transmitted 4, in filter 4
reference time:    dbfe91f0.e0ab0269  Sat, Dec 17 2016  0:16:48.877
originate timestamp: dbfe920f.cce69aec  Sat, Dec 17 2016  0:17:19.800
transmit timestamp:  dbfe920f.c9ccaaf5  Sat, Dec 17 2016  0:17:19.788
filter delay:  0.06631  0.06557  0.06557  0.06583 
         0.00000  0.00000  0.00000  0.00000 
filter offset: -0.00835 -0.00782 -0.00800 -0.00801
         0.000000 0.000000 0.000000 0.000000
delay 0.06557, dispersion 0.00020
offset -0.007821


17 Dec 00:17:19 ntpdate[26682]: adjust time server 182.92.12.11 offset -0.007821 sec


發現同樣的ntp.sjtu.edu.cn域名,解析出來的IP居然不一樣!!!!

然後在同步時間有問題的那臺機器上面這樣執行:ntpdate -d 182.92.12.11

17 Dec 00:22:12 ntpdate[4876]: ntpdate [email protected] Mon Nov 14 18:25:09 UTC 2016 (1)
Looking for host 182.92.12.11 and service ntp
host found : time5.aliyun.com
^[[C^[[Atransmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
transmit(182.92.12.11)
receive(182.92.12.11)
server 182.92.12.11, port 123
stratum 2, precision -24, leap 00, trust 000
refid [182.92.12.11], delay 0.11998, dispersion 0.02696
transmitted 4, in filter 4
reference time:    dbfe9340.e0a6e895  Sat, Dec 17 2016  0:22:24.877
originate timestamp: dbfe9341.f1042a0c  Sat, Dec 17 2016  0:22:25.941
transmit timestamp:  dbfe933a.876de705  Sat, Dec 17 2016  0:22:18.529
filter delay:  0.11998  0.28513  0.22147  0.13644 
         0.00000  0.00000  0.00000  0.00000 
filter offset: 7.335746 7.322472 7.394457 7.357022
         0.000000 0.000000 0.000000 0.000000
delay 0.11998, dispersion 0.02696
offset 7.335746


17 Dec 00:22:18 ntpdate[4876]: step time server 182.92.12.11 offset 7.335746 sec


奇蹟出現了,居然同步到時間了!不知道為什麼會解析到那個IP上面,不知道是dns解析到錯誤的IP,還是那個IP不能同步時間。反正就是換個IP就能解決。