一台centos最小化安装的机器,yum -y install ntpdate安装ntpdate同步时间。执行ntpdate time.nist.gov,无法与服务器同步时间,并出现以下错误:ntpdate[1897]: no server suitable for synchronization found
执行:ntpdate -d time.nist.gov命令调试的时候,打印结果如下:
ntpdate[1976]: ntpdate 4.2.6p5@1.2349-o Mon Feb 6 07:22:46 UTC 2017 (1)
Looking for host time.nist.gov and service ntp
host found : nist1-lnk.binary.net
transmit(216.229.0.179)
transmit(216.229.0.179)
transmit(216.229.0.179)
transmit(216.229.0.179)
transmit(216.229.0.179)
216.229.0.179: Server dropped: no data
意思是客户端发往服务器的transmit包无响应,windows环境下ping time.nist.gov可以正常解析服务器的ip,而contos客户端ping time.nist.gov则不能正常解析域名的ip。 试用命令ntpdate -d 216.229.0.179调试,打印结果如下: ntpdate[1977]: ntpdate 4.2.6p5@1.2349-o Mon Feb 6 07:22:46 UTC 2017 (1)
Looking for host 216.229.0.179 and service ntp
host found : nist1-lnk.binary.net
transmit(216.229.0.179)
receive(216.229.0.179)
transmit(216.229.0.179)
receive(216.229.0.179)
transmit(216.229.0.179)
receive(216.229.0.179)
transmit(216.229.0.179)
transmit(216.229.0.179)
server 216.229.0.179, port 123
stratum 1, precision -29, leap 00, trust 000
refid [ACTS], delay 0.25931, dispersion 8.00000
transmitted 4, in filter 4
reference time: dc5d5e5a.4c1e35c6 Sun, Feb 26 2017 22:02:02.297
originate timestamp: dc5d5e8b.668a82f6 Sun, Feb 26 2017 22:02:51.400
transmit timestamp: dc57bb36.5fc3fc0b Wed, Feb 22 2017 15:24:38.374
filter delay: 0.30286 0.26347 0.25931 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 369493.1 369493.1 369493.1 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.25931, dispersion 8.00000
offset 369493.143347
说明使用IP方式,可以同步服务器的时间。执行命令:
ntpdate 216.229.0.179
26 Feb 22:03:13 ntpdate[1978]: step time server 216.229.0.179 offset 369493.008399 sec 解决问题
转载于:https://blog.51cto.com/12209051/1901491