當(dāng)用ntpdate -d 來(lái)查詢(xún)時(shí)會(huì)發(fā)現(xiàn)導(dǎo)致 no server suitable for synchronization found 的錯(cuò)誤的信息有以下2個(gè):
錯(cuò)誤1.Server dropped: Strata too high
在ntp客戶(hù)端運(yùn)行ntpdate serverIP,出現(xiàn)no server suitable for synchronization found的錯(cuò)誤。
在ntp客戶(hù)端用ntpdate –d serverIP查看,發(fā)現(xiàn)有“Server dropped: strata too high”的錯(cuò)誤,并且顯示“stratum 16”。而正常情況下stratum這個(gè)值得范圍是“0~15”。
這是因?yàn)镹TP server還沒(méi)有和其自身或者它的server同步上。
以下的定義是讓NTP Server和其自身保持同步,如果在/ntp.conf中定義的server都不可用時(shí),將使用local時(shí)間作為ntp服務(wù)提供給ntp客戶(hù)端。
server 127.127.1.0fudge
127.127.1.0 stratum 8
在ntp server上重新啟動(dòng)ntp服務(wù)后,ntp server自身或者與其server的同步的需要一個(gè)時(shí)間段,這個(gè)過(guò)程可能是5分鐘,在這個(gè)時(shí)間之內(nèi)在客戶(hù)端運(yùn)行ntpdate命令時(shí)會(huì)產(chǎn)生no server suitable for synchronization found的錯(cuò)誤。
那么如何知道何時(shí)ntp server完成了和自身同步的過(guò)程呢?
在ntp server上使用命令:
出現(xiàn)畫(huà)面:
Every 2.0s: ntpq -p Thu Jul 10 02:28:32 2008
remote refid st t when poll reach delay offset jitter
=======================================================
192.168.30.22 LOCAL(0) 8 u 22 64 1 2.113 179133. 0.001
LOCAL(0) LOCAL(0) 10 l 21 64 1 0.000 0.000 0.001
注意LOCAL的這個(gè)就是與自身同步的ntp server。
注意reach這個(gè)值,在啟動(dòng)ntp server服務(wù)后,這個(gè)值就從0開(kāi)始不斷增加,當(dāng)增加到17的時(shí)候,從0到17是5次的變更,每一次是poll的值的秒數(shù),是64秒*5=320秒的時(shí)間。
如果之后從ntp客戶(hù)端同步ntp server還失敗的話(huà),用ntpdate –d來(lái)查詢(xún)?cè)敿?xì)錯(cuò)誤信息,再做判斷。
錯(cuò)誤2.Server dropped: no data
從客戶(hù)端執(zhí)行netdate –d時(shí)有錯(cuò)誤信息如下:
transmit(192.168.30.22)
transmit(192.168.30.22)
transmit(192.168.30.22)
transmit(192.168.30.22)
192.168.30.22: Server dropped: no data
server 192.168.30.22, port 123
出現(xiàn)這個(gè)問(wèn)題的原因可能有2:
1。檢查ntp的版本,如果你使用的是ntp4.2(包括4.2)之后的版本,在restrict的定義中使用了notrust的話(huà),會(huì)導(dǎo)致以上錯(cuò)誤。
使用以下命令檢查ntp的版本:
下面是來(lái)自ntp官方網(wǎng)站的說(shuō)明:
The behavior of notrust changed between versions 4.1 and 4.2.
In 4.1 (and earlier) notrust meant "Don't trust this host/subnet for time".
In 4.2 (and later) notrust means "Ignore all NTP packets that are not cryptographically authenticated." This forces remote time servers to authenticate themselves to your (client) ntpd
解決:
把notrust去掉。
2。檢查ntp server的防火墻??赡苁莝erver的防火墻屏蔽了upd 123端口。
可以用命令
來(lái)關(guān)掉iptables服務(wù)后再?lài)L試從ntp客戶(hù)端的同步,如果成功,證明是防火墻的問(wèn)題,需要更改iptables的設(shè)置。
以上這篇完美解決ntp的錯(cuò)誤問(wèn)題no server suitable for synchronization fo就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
標(biāo)簽:懷化 新疆 贛州 惠州 亳州 北京 河南 九江
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《完美解決ntp的錯(cuò)誤問(wèn)題no server suitable for synchronization fo》,本文關(guān)鍵詞 完美,解決,ntp,的,錯(cuò)誤,問(wèn)題,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。