我在与 NTP 服务器同步时遇到了一些问题。
1) NTP 守护程序根本不同步系统时钟,即使它正在运行(已通过 确认/etc/init.d/ntp status
)。强制与ntpd -q
或同步ntpd -gq
也不起作用。
2)停止 NTP 守护进程并使用 ntpdate 手动同步确实给了我以下输出:
~# ntpdate -d 0.debian.pool.ntp.org
6 Nov 16:48:53 ntpdate[4417]: ntpdate [email protected] Sat May 12 09:07:19 UTC 2012 (1)
transmit(79.132.237.5)
receive(79.132.237.5)
transmit(85.234.197.2)
receive(85.234.197.2)
transmit(194.50.97.34)
receive(194.50.97.34)
transmit(79.132.237.1)
receive(79.132.237.1)
transmit(79.132.237.5)
receive(79.132.237.5)
transmit(85.234.197.2)
receive(85.234.197.2)
transmit(194.50.97.34)
receive(194.50.97.34)
transmit(79.132.237.1)
receive(79.132.237.1)
transmit(79.132.237.5)
receive(79.132.237.5)
transmit(85.234.197.2)
receive(85.234.197.2)
transmit(194.50.97.34)
receive(194.50.97.34)
transmit(79.132.237.1)
receive(79.132.237.1)
transmit(79.132.237.5)
receive(79.132.237.5)
transmit(85.234.197.2)
receive(85.234.197.2)
transmit(194.50.97.34)
receive(194.50.97.34)
transmit(79.132.237.1)
receive(79.132.237.1)
server 79.132.237.5, port 123
stratum 2, precision -20, leap 00, trust 000
refid [79.132.237.5], delay 0.05141, dispersion 0.00145
transmitted 4, in filter 4
reference time: d624e3b1.f490b90d Wed, Nov 6 2013 16:50:09.955
originate timestamp: d624e457.eaaf787c Wed, Nov 6 2013 16:52:55.916
transmit timestamp: d624e36c.4a7036fd Wed, Nov 6 2013 16:49:00.290
filter delay: 0.08537 0.05141 0.05151 0.06346
0.00000 0.00000 0.00000 0.00000
filter offset: 235.6038 235.6087 235.6095 235.6068
0.000000 0.000000 0.000000 0.000000
delay 0.05141, dispersion 0.00145
offset 235.608782
server 85.234.197.2, port 123
stratum 2, precision -20, leap 00, trust 000
refid [85.234.197.2], delay 0.05151, dispersion 0.00336
transmitted 4, in filter 4
reference time: d624e3e7.dc6cd02b Wed, Nov 6 2013 16:51:03.861
originate timestamp: d624e458.1c91031f Wed, Nov 6 2013 16:52:56.111
transmit timestamp: d624e36c.7da1d882 Wed, Nov 6 2013 16:49:00.490
filter delay: 0.05765 0.07750 0.06013 0.05151
0.00000 0.00000 0.00000 0.00000
filter offset: 235.6048 235.6014 235.6035 235.6078
0.000000 0.000000 0.000000 0.000000
delay 0.05151, dispersion 0.00336
offset 235.607826
server 194.50.97.34, port 123
stratum 3, precision -23, leap 00, trust 000
refid [194.50.97.34], delay 0.03021, dispersion 0.00090
transmitted 4, in filter 4
reference time: d624e38d.2bce952c Wed, Nov 6 2013 16:49:33.171
originate timestamp: d624e458.4dbbc114 Wed, Nov 6 2013 16:52:56.303
transmit timestamp: d624e36c.b0d38834 Wed, Nov 6 2013 16:49:00.690
filter delay: 0.03030 0.03636 0.03091 0.03021
0.00000 0.00000 0.00000 0.00000
filter offset: 235.6095 235.6085 235.6098 235.6105
0.000000 0.000000 0.000000 0.000000
delay 0.03021, dispersion 0.00090
offset 235.610589
server 79.132.237.1, port 123
stratum 3, precision -20, leap 00, trust 000
refid [79.132.237.1], delay 0.05113, dispersion 0.00305
transmitted 4, in filter 4
reference time: d624dfcb.6acea332 Wed, Nov 6 2013 16:33:31.417
originate timestamp: d624e458.838672ad Wed, Nov 6 2013 16:52:56.513
transmit timestamp: d624e36c.e405181c Wed, Nov 6 2013 16:49:00.890
filter delay: 0.06345 0.05113 0.05681 0.05656
0.00000 0.00000 0.00000 0.00000
filter offset: 235.6087 235.6038 235.6010 235.6074
0.000000 0.000000 0.000000 0.000000
delay 0.05113, dispersion 0.00305
offset 235.603888
6 Nov 16:49:00 ntpdate[4417]: step time server 79.132.237.5 offset 235.608782 sec
显然,ntpdate 可以到达 NTP 服务器,但检查时钟后,它并没有改变,仍然显示错误的时间。
如果有任何想法,问题可能出在哪里,我们将不胜感激。
答案1
尝试这个:
# date
# ntpdate -b 0.debian.pool.ntp.org
# date
你的时钟更新了吗?