更新至 CentOS 6.5 后 NTP 停止工作

更新至 CentOS 6.5 后 NTP 停止工作

几天前,我在网络上设置了 ntp,一切运行正常。一个节点设置为与上游服务器同步,其余节点设置为与上游同步。

昨天我从 CentOS 6.4 更新到 6.5,现在所有 ntp 功能都已停止按预期运行。

为了尝试调试情况,我在上游服务器上运行了以下命令:

$ -> ntpq -pnd
::1: timed out, nothing received
***Request timed out

$ -> ntpq -4 -pnd
1 packets reassembled into response
remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
2 packets reassembled into response
*50.116.55.65    64.246.132.14    2 u   42   64   37   77.742  189.392  14.812
2 packets reassembled into response
 199.102.46.73   .GPS.            1 u   44   64   37   73.786  216.082  18.406
2 packets reassembled into response
 198.60.22.240   .GPS.            1 u   48   64   37   22.617  189.405  15.996
2 packets reassembled into response
 127.127.1.0     .LOCL.          10 l  306   64   20    0.000    0.000   0.000

我在节点上得到了相同的结果(除了不同的 IP)。似乎 ntp 服务以某种方式默认为 ipv6,而我尚未配置。我读过一些网站说要将 -4 传递给 ntpd 服务,但我该如何使用 chkconfig 来做到这一点?其他一些阅读表明我应该通过内核禁用 ipv6,但这似乎有点过头了。

有什么建议么?

为了完整性,添加配置文件:

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1

restrict 10.0.0.0 mask 255.255.192.0 nomodify notrap


server 0.centos.pool.ntp.org iburst

server 1.centos.pool.ntp.org

server 2.centos.pool.ntp.org


# In case net access is temporarily down
server 127.127.1.0
fudge 127.127.1.0 stratum 10

答案1

由于它尝试使用 IPv6,您可能希望在配置文件中允许它:

restrict -6 ::1

相关内容