我试图在time{1,4}.google.com同步我的Ubuntu 12.04.5实例与Google time{1,4}.google.com服务器,并且可以使用ntpdate和ntpd成功查询,但是一旦我启动ntp作为服务,它将无法联系时间服务器。 不知道为什么我可以做一个,但不是另一个?
用ntpdate查询工作:
$ ntpdate time1.google.com 14 Feb 10:47:28 ntpdate[17245]: adjust time server 216.239.35.0 offset 0.015588 sec
与ntpd查询一样:
$ ntpd -q -g -c /etc/ntp.conf ntpd: time slew -0.004094s
但是我在启动ntpd服务后在ntpq中看到的所有内容都是INIT:
$ service ntp start $ ntpq -n ntpq> peers remote refid st t when poll reach delay offset jitter ============================================================================== <local IP> .INIT. 16 u - 64 0 0.000 0.000 0.000 216.239.35.0 .INIT. 16 u - 64 0 0.000 0.000 0.000 216.239.35.4 .INIT. 16 u - 64 0 0.000 0.000 0.000 216.239.35.8 .INIT. 16 u - 64 0 0.000 0.000 0.000 216.239.35.12 .INIT. 16 u - 64 0 0.000 0.000 0.000
而且这个状态并没有改变。 我的ntp.conf文件完全由Google服务器组成,没有其他的东西(没有限制行):
$ cat /etc/ntp.conf server time1.google.com server time2.google.com server time3.google.com server time4.google.com
在15分钟后回来再次检查。
客户端通常需要几分钟的时间才能同步到服务器。
当第一次启动并且频率文件不存在时,守护进程进入特殊模式以校准频率。 这需要900秒,在这段时间没有纪律。
http://doc.ntp.org/current-stable/debug.html
debugging页面还显示了一些更多的variables,特别是associations命令。
pipe理解决这个; 这是由于初始化脚本硬编码不同的configuration文件比标准的configuration文件,这意味着我的configuration文件更新没有任何效果,并在实际使用的configuration文件中的restrict值是不正确的。