AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1043979
Accepted
Zumo de Vidrio
Zumo de Vidrio
Asked: 2020-11-27 01:14:56 +0800 CST2020-11-27 01:14:56 +0800 CST 2020-11-27 01:14:56 +0800 CST

NTP 始终在本地同步

  • 772

我有一个具有以下 NTP 配置的 Ubuntu 16.04:

driftfile /var/lib/ntp/drift

restrict -4 default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1 nomodify notrap
restrict 10.0.200.15 mask 255.255.255.0 nomodify notrap

server 127.127.1.0
fudge 127.127.1.0 stratum 10

server 0.ntp.pool.org iburst prefer minpoll 4 maxpoll 7
server 1.ntp.pool.org iburst prefer minpoll 4 maxpoll 7
server 2.ntp.pool.org iburst prefer minpoll 4 maxpoll 7
tinker panic 0

restrict 127.0.0.1
restrict -6 ::1

但它总是与 localhost 同步(我认为是因为层值较低):

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.1.0     .LOCL.          10 l  16h   64    0    0.000    0.000   0.000
 64.99.80.121    .STEP.          16 u    -  128    0    0.000    0.000   0.000

但是我希望它与外部 NTP 同步ntp.pool.org

我已将 ubuntu ntp 服务器添加到 ntp.conf 文件中:

server ntp.ubuntu.com iburst prefer minpoll 4 maxpoll 7

现在我看到它有一个第 2 层,并且 ntp 能够与之同步:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.1.0     .LOCL.          10 l  16h   64    0    0.000    0.000   0.000
 64.99.80.121    .STEP.          16 u    -  128    0    0.000    0.000   0.000
*91.189.91.157   194.58.200.20    2 u   15  128  377   79.191    0.042   1.964

为ntptrace两台服务器提供超时:

$ ntptrace ntp.ubuntu.com
ntp.ubuntu.com: timed out, nothing received
***Request timed out
$ ntptrace ntp.pool.org
ntp.pool.org: timed out, nothing received
***Request timed out

我是否缺少一些只能与同步的配置ntp.pool.org?

我已经在这里检查了答案, 但我没有找到适合我的案例的答案


更新

此 VM 将充当其他 VM 的 ntp 服务器。

查询结果:

ntpdate -q ntp.pool.org
server 64.99.80.121, stratum 0, offset 0.000000, delay 0.00000
26 Nov 14:34:37 ntpdate[4577]: no server suitable for synchronization found
ntpdate -q ntp.ubuntu.com
server 91.189.94.4, stratum 2, offset 0.000290, delay 0.03615
server 91.189.89.199, stratum 2, offset 0.000654, delay 0.03668
server 91.189.89.198, stratum 2, offset -0.000251, delay 0.03674
server 91.189.91.157, stratum 2, offset 0.000159, delay 0.10548
26 Nov 14:36:15 ntpdate[4585]: adjust time server 91.189.94.4 offset 0.000290 sec

我在 ntp 文档中发现第 16 层表明 ntp 服务器存在一些问题。我们可以得出结论,这ntp.pool.org是行不通的吗?

linux ntp time-synchronization ntpd
  • 2 2 个回答
  • 572 Views

2 个回答

  • Voted
  1. Best Answer
    deceleratedcaviar
    2021-04-18T06:32:56+08:002021-04-18T06:32:56+08:00

    ntp.pool.org

    应该

    池.ntp.org

    (参考:https ://www.pool.ntp.org )

    • 2
  2. Paul Gear
    2020-11-28T19:48:02+08:002020-11-28T19:48:02+08:00

    简短版本:是的,您缺少允许池配置工作的配置。

    长版:

    1. 你应该从默认的 Ubuntu 开始ntp.conf,而不是你的模板。您还应该使您的配置尽可能接近默认配置,以便与新版本的默认配置轻松合并,并尽量减少对池服务器的影响。(特别是,最好不要摆弄maxpoll.)在您的情况下,您唯一需要更改的是添加tinker panic 0和本地服务器。你不应该使用server 127.127.1.0and fudge 127.127.1.0 ...。

    2. ntptrace查询公共服务器超时是很正常的。它用于查询服务器的方法容易受到 DDoS 攻击,因此在现代ntpd版本中默认禁用。

    3. 您缺少的默认配置部分是:restrict source notrap nomodify noquery. 它标有注释“需要添加池条目”。:-)

    • 0

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve