解決ntp的錯誤no server suitable for synchronization found

來源:互聯網
上載者:User

解決ntp的錯誤 no server suitable for synchronization found 當用ntpdate -d 來查詢時會發現導致 no server suitable for synchronization found 的錯誤的資訊有以下2個:   錯誤1.Server dropped: Strata too high 在ntp用戶端運行ntpdate serverIP,出現no server suitable for synchronization found的錯誤。 在ntp用戶端用ntpdate –d serverIP查看,發現有“Server dropped: strata too high”的錯誤,並且顯示“stratum 16”。而正常情況下stratum這個值得範圍是“0~15”。 這是因為NTP server還沒有和其自身或者它的server同步上。 以下的定義是讓NTP Server和其自身保持同步,如果在/ntp.conf中定義的server都不可用時,將使用local時間作為ntp服務提供給ntp用戶端。 server 127.127.1.0fudge 127.127.1.0 stratum 8    在ntp server上重新啟動ntp服務後,ntp server自身或者與其server的同步的需要一個時間段,這個過程可能是5分鐘,在這個時間之內在用戶端運行ntpdate命令時會產生no server suitable for synchronization found的錯誤。 那麼如何知道何時ntp server完成了和自身同步的過程呢? 在ntp server上使用命令: # watch ntpq -p 出現畫面: 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的這個就是與自身同步的ntp server。 注意reach這個值,在啟動ntp server服務後,這個值就從0開始不斷增加,當增加到17的時候,從0到17是5次的變更,每一次是poll的值的秒數,是64秒*5=320秒的時間。 如果之後從ntp用戶端同步ntp server還失敗的話,用ntpdate –d來查詢詳細錯誤資訊,再做判斷。 錯誤2.Server dropped: no data 從用戶端執行netdate –d時有錯誤資訊如下:     transmit(192.168.30.22)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     .....28 Jul 17:42:24 ntpdate[14148]: no server suitable for synchronization found  出現這個問題的原因可能有2: 1。檢查ntp的版本,如果你使用的是ntp4.2(包括4.2)之後的版本,在restrict的定義中使用了notrust的話,會導致以上錯誤。 使用以下命令檢查ntp的版本: # ntpq -c version 下面是來自ntp官方網站的說明: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的防火牆。可能是server的防火牆屏蔽了upd 123連接埠。 可以用命令 #service iptables stop  來關掉iptables服務後再嘗試從ntp用戶端的同步,如果成功,證明是防火牆的問題,需要更改iptables的設定。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.