无法找到 ntp 配置错误的根本原因

无法找到 ntp 配置错误的根本原因

我正在尝试配置 ntp 来同步我的服务器的时间。运行时ntpdate -dq 1.rhel.pool.ntp.org出现以下错误。

未找到适合同步的服务器

我处于专业环境中,因此我猜测有一个防火墙阻止了与 ntp 服务器的连接,但我不知道如何证明和解决它。

我尝试关注这个帖子:NTP 无法同步或找不到合适的服务器但我无法做到ping 1.rhel.pool.ntp.orgping命令没有响应。

我正在使用 Red Hat 4.1.2。您能帮我调查并找出根本原因吗?

编辑

根据评论,您可以输出一些命令

[root@MY ~]# iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

答案1

24 Jun 16:46:38 ntpdate[30431]: ntpdate [email protected] Fri Apr 10 19:04:04 UTC 2015 (1)
server 91.148.192.49, stratum 2, offset 0.029175, delay 0.03041
server 95.211.224.12, stratum 2, offset 0.025579, delay 0.03125
server 37.97.195.195, stratum 2, offset 0.025274, delay 0.02983
server 213.109.127.195, stratum 2, offset 0.023653, delay 0.03355
24 Jun 16:46:54 ntpdate[30431]: adjust time server 37.97.195.195 offset 0.025274 sec

您提到您处于专业环境中。话虽如此,阻止从 WAN 到任何 NTP 的访问并仅允许一台特定机器更新是很常见的。这将成为您的本地 NTP 服务器。

请检查:您没有使用 iptables 阻止端口:

iptables -L -n -v | grep 123

如果您在那里找不到任何东西,那么您可能被上游阻止了,请检查服务器是否已启动并正在运行:

https://keetweej.vanheusden.com/query_ntp_do.php

您将发现与您提供的 NTP 服务器的输出相同的输出。

不幸的是,如果您被上游阻止,您应该联系提供商 IT 人员来解除对您的服务器的阻止或询问您应该查询哪个 NTP 服务器?

相关内容