当用ntpdate -d来查询时会发现致使no server suitable for synchronization found的错误的信息有如下2个,错误1是Server dropped: Strata too high,错误2是Server dropped:no data,下面逐个分析。网站
错误1:Server dropped: Strata too highui
在ntp客户端运行ntpdate serverIP,出现no server suitable for synchronization found的错误。this
在ntp客户端用ntpdate –d serverIP查看,发现有“Server dropped: strata too high”的错误,而且显示“stratum 16”。而正常状况下stratum这个值得范围是“0~15”。spa
这是由于NTP server尚未和其自身或者它的server同步上。rest
如下的定义是让NTP Server和其自身保持同步,若是在/ntp.conf中定义的server都不可用时,将使用local时间做为ntp服务提供给ntp客户端。server
server 127.127.1.0ip
fudge 127.127.1.0 stratum 8 rem
在ntp server上从新启动ntp服务后,ntp server自身或者与其server的同步的须要一个时间段,这个过程多是5分钟,在这个时间以内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。同步
那么如何知道什么时候ntp server完成了和自身同步的过程呢?it
在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的设置。