无法连接到 NTP 服务器 [英] Cannot connect to NTP server

查看:223
本文介绍了无法连接到 NTP 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照此处的说明将我的时钟与 NTP 服务器同步http://support.ntp.org/bin/view/Support/GettingStarted ,但这不起作用.

I am trying to synchronize my clock with a NTP server by following the instructions here http://support.ntp.org/bin/view/Support/GettingStarted , but this does not work.

我使用的是 Mac OS X El Capitan 10.11.2,这就是我所做的.我选择了服务器 ntp.your.org ( http://support.ntp.org/bin/view/Servers/PublicTimeServer000498 ),我将我的计算机与它同步:

I am on Mac OS X El Capitan 10.11.2, and here is what I do. I picked server ntp.your.org ( http://support.ntp.org/bin/view/Servers/PublicTimeServer000498 ) and I synchronize my computer with it:

XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ sudo ntpdate -b ntp.your.org
31 Mar 20:05:04 ntpdate[43114]: step time server 204.9.54.119 offset -0.005629 sec

然后检查它是否有效,我会

Then to check that it works, I do

XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ ntpdc -c peers
nodename nor servname provided, or not known

另外,如果我做 ntpq 我得到

Also, if I do ntpq I get

XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ ntpq -pcrv
 nodename nor servname provided, or not known

如果我通过将互联网连接切换到不同的 WIFI 网络来做同样的事情,我会得到不同的输出:

while if I do the same by switching my internet connection to a different WIFI network, I get a different output:

XXX-macbook-pro-2:XXX XXX$ ntpq -pcrv
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ntp.your.org    .INIT.          16 u    -   64    0    0.000    0.000   0.000
associd=0 status=c012 leap_alarm, sync_unspec, 1 event, freq_set,
version="ntpd 4.2.6@1.2089-o Fri May 28 01:20:53 UTC 2010 (1)",
processor="x86_64", system="Darwin/15.2.0", leap=11, stratum=16,
precision=-20, rootdelay=0.000, rootdisp=0.075, refid=INIT,
reftime=00000000.00000000  Mon, Jan  1 1900  0:09:21.000,
clock=daa9468e.835891f4  Fri, Apr  1 2016 21:12:14.513, peer=0, tc=3,
mintc=3, offset=0.000, frequency=-47.221, sys_jitter=0.000,
clk_jitter=0.001, clk_wander=0.000

你知道这底部的问题是什么吗?

Do you have any idea of what is the issue at the bottom of this?

谢谢.

推荐答案

根据您在更改网络时提供的输出,我相信这是一个网络问题.

From the output you provided when you changed networks leads me to believe this is a network issue.

您发布的原始问题在这篇帖子和另一篇此处.它们都指向 IP 配置问题 - DNS 或 DHCP.

The original problem you posted is referenced in this post and another here. They both point towards an IP config issue - either DNS or DHCP.

看起来 123/UDP 端口可能在主机或网络路由器/网关/防火墙上被阻止.您需要检查这一点,或者连接到您知道没有端口被阻止的网络.除非您有不同的 IP 配置或安全设置,否则有线或 wifi 应该无关紧要.

It looks like port 123/UDP might be blocked either on the host machine or the network router/gateway/firewall. You need to check this, or connect to a network where you know no ports are blocked. Wired or wifi shouldn't matter unless you have different IP Config or security settings.

事实上,一旦你改变了网络,你就会看到 reach = 0 &refif = .INIT. 表示您可以解析 ntp 服务器 (ntp.your.org),但无法连接到它.

The fact that once you changed networks you see reach = 0 & refif = .INIT. says that you can resolve the ntp server (ntp.your.org) but you can't connect to it.

从工作设置中,您希望看到如下内容(摘自我对超级用户的回答之一 - 地址已删除)

From a working setup you would expect to see something like this below (Taken from one of my answers on SuperUser - addresses removed)

 remote           refid          st t when poll reach   delay   offset  jitter
==============================================================================
 PRIVATE         .STEP.          16 u    - 1024    0    0.000    0.000   0.000
-PRIVATE1        .GPS.            1 u   55   64  377   29.585    0.071   0.312
-PRIVATE2        .GPS.            1 u   40   64  377    9.468    0.209   0.129
-PRIVATE3        1.1.1.1          2 u   12   64  377    6.943   -0.270   0.142
-PRIVATE5        .PPS.            1 u   20   64  377   16.383   -0.531   0.197
+PRIVATE6        .DCFa.           1 u   22   64  377    8.661   -0.036   0.126
-ISP1            2.2.2.2          2 u   36   64  377   11.720   -0.027   0.280
#PRIVATE7        .GPS.            1 u   47   64  377   24.781   -1.405   1.118
+ISP2            .PPS.            1 u    4   64  377    6.012    0.062   0.154
-ISP3            .PPS.            1 u   14   64  377   13.993   -0.463   0.206
-ISP4            .CDMA.           1 u   57   64  377   71.712   -0.109   0.249
 ntp.mcast.net   .MCST.          16 u    -   64    0    0.000    0.000   0.002
 LOCAL(0)        .LOCL.          10 l  69d   64    0    0.000    0.000   0.000
xSHM(0)          .GPS.            0 l    9   16  377    0.000  -25.278   7.907
*SHM(1)          .PPS.            0 l   11   16  377    0.000   -0.030   0.060
associd=0 status=0488 leap_none, sync_uhf_radio, 8 events, no_sys_peer,
version="ntpd 4.2.6p5@1.2349-o Sat Nov 23 18:21:48 UTC 2013 (1)",
processor="x86_64", system="Linux/3.13.3-1.el6.elrepo.x86_64", leap=00,
stratum=1, precision=-19, rootdelay=0.000, rootdisp=0.435, refid=PPS,
reftime=d81f71b3.9b5a018c  Tue, Nov 25 2014 21:22:59.606,
clock=d81f71be.1f3892d4  Tue, Nov 25 2014 21:23:10.121, peer=28309, tc=4,
mintc=3, offset=-0.021, frequency=-69.212, sys_jitter=0.031,
clk_jitter=0.145, clk_wander=0.031

值得指出的是,ntp 最满意的是最少 3 台服务器,最好是 5 台服务器才能正常工作,并相应地选择最佳"计时源.

It's worth pointing out that ntp is most happy with a minimum of 3 servers and ideally 5 for it to work correctly, and pick the 'best' timing source accordingly.

文档这里 将帮助其他领域也相关.

The docs here will help with what some of the other fields relate too.

我也认为这个问题应该迁移到 SuperUser 因为它不是一个与编程相关的问题.

I'm also thinking this question should be migrated to SuperUser as its not a programming related question.

这篇关于无法连接到 NTP 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆