ntp同步提示no server suitable for synchronization found

    Read

操作系统:Centos 6.4

备注:Centos 6.4的ntpdate 在/usr/sbin/ntpdate,而Centos 5.X的ntpdate在/sbin/ntpdate,如果不确定可以尝试find一下。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/






原因:
①:开启防火墙后可以收到回应包,证明是防火墙的原因,生产环境中,开启udp123端口即可;SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

②:可能的因素是在/etc/ntp.conf中禁止了相关notrust参数。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

1。检查ntp的版本,如果你使用的是ntp4.2(包括4.2)之后的版本,在restrict的定义中使用了notrust的话,会导致以上错误。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

使用以下命令检查ntp的版本:


下面是来自ntp官方网站的说明:
The behavior of notrust changed between versions 4.1 and 4.2.SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

In 4.1 (and earlier) notrust meant "Don't trust this host/subnet for time".SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

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) ntpdSourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

解决:SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

把notrust去掉。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

补充内容(非原创):
当用ntpdate -d 来查询时会发现导致 no server suitable for synchronization found 的错误的信息有以下2个: SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

错误1.Server dropped: Strata too highSourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

在ntp客户端运行ntpdate serverIP,出现no server suitable for synchronization found的错误。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

在ntp客户端用ntpdate –d serverIP查看,发现有“Server dropped: strata too high”的错误,并且显示“stratum 16”。而正常情况下stratum这个值得范围是“0~15”。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

这是因为NTP server还没有和其自身或者它的server同步上。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

以下的定义是让NTP Server和其自身保持同步,如果在/ntp.conf中定义的server都不可用时,将使用local时间作为ntp服务提供给ntp客户端。


在ntp server上重新启动ntp服务后,ntp server自身或者与其server的同步的需要一个时间段,这个过程可能是5分钟,在这个时间之内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

那么如何知道何时ntp server完成了和自身同步的过程呢?SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

在ntp server上使用命令:


出现画面:

注意LOCAL的这个就是与自身同步的ntp server。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

注意reach这个值,在启动ntp server服务后,这个值就从0开始不断增加,当增加到17的时候,从0到17是5次的变更,每一次是poll的值的秒数,是64秒*5=320秒的时间。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

如果之后从ntp客户端同步ntp server还失败的话,用ntpdate –d来查询详细错误信息,再做判断。SourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

申明:本文由BYRD原创(基于Centos6.4 X64),未经许可禁止转载!
参考地址:http://www.blogjava.net/spray/archive/2008/07/10/213964.html
参考地址:http://blog.sina.com.cn/s/blog_3f1a25310100qn84.html
参考地址:http://wiki.ubuntu.org.cn/NTPSourceByrd's Weblog-https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/

Today in History
March
30
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on March 30, 2014
  • 原文链接:https://note.t4x.org/error/ntp-no-server-suitable-synchronization-found/
Comments  1  Guest  0  Pingback  1
匿名

Comment

Anonymous

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: