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
    • 最新
    • 标签
主页 / user-777311

vivek's questions

Martin Hope
vivek
Asked: 2021-07-24 20:27:20 +0800 CST

如果网络连接稍晚一点,ntpd 不会同步时钟

  • 0

在我们的生产环境中,我面临着 ntpd 的问题。我正在为我们的生产盒启用 NTP 功能并观察一个问题。

我们在盒子的初始化过程中启动 ntpd 守护进程。在那段时间互联网连接不存在。下面是我的小ntp.conf文件

driftfile  /etc/ntp.drift
logconfig =syncstatus
server pool.ntp.org iburst

一旦接口出现,我们的盒子就可以很晚地获得互联网连接。那个时候我看到 ntpd 没有同步时钟。当我这样做时ntpq -c as,我得到了no association id's found。我确实等了将近 30 分钟,但还是得到了no association id's found

我必须重新启动ntpd。重启后,ntpd 同步时钟,一切正常。但是,如果我重新启动我的盒子,那么同样的问题就会发生。再次,我必须重新启动 ntpd,一旦盒子出现并且可以访问互联网。

有没有人遇到过类似的问题?

我应该延迟 ntpd 的启动直到时间界面出现吗?

更新

我做了一些更多的实验,并用这个更改替换server pool.ntp.org iburst了pool pool.ntp.org iburstntpd 自动同步时钟。我不必重新启动 ntpd。所以这里对我提出了另一个问题。

当我替换为 时发生server了pool什么?

我应该总是使用pool关键字而不是server?

我应该什么时候使用pool,什么时候应该使用server?

我做了一些研究,发现 pool is the same as server, except it resolves one name into several addresses and uses them all 如果他们在做同样的事情,那为什么server pool.ntp.org iburst不为我工作但pool pool.ntp.org iburst工作。

更新

正如建议的那样,我已经使用pool了,server但我的时钟仍然无法在启动时同步。以前no association id's found来过,但在使用池后它正在显示列表。

GW:/admin# ntpq -c lpeer
     remote           refid      st t when poll reach   delay    offset  jitter
===================================================================== =========
 time.google.com .POOL.          16 p    -   64    0    0.000   +0.000   0.002

GW:/admin# ntpq -np
      remote           refid      st t when poll reach   delay   offset  jitter

 time.google.com .POOL.          16 p    -   64    0    0.000   +0.000   0.002

GW:/admin# ntpq -c as
ind assid status  conf reach auth condition  last_event cnt
===========================================================
  1 34173  8811   yes  none  none    reject    mobilize  1

GW:/admin# ntpq -c "rv 34173"
associd=34173 status=8811 conf, bcast, sel_reject, 1 event, mobilize,
srcadr=0.0.0.0, srcport=0, srchost="time.google.com", dstadr=0.0.0.0,
dstport=0, leap=11, stratum=16, precision=-19, rootdelay=0.000,
rootdisp=0.000, refid=POOL, reftime=(no time), rec=(no time), reach=000,
unreach=0, hmode=3, pmode=0, hpoll=6, ppoll=10, headway=0,
flash=1400 peer_dist, peer_unreach, keyid=0, offset=+0.000, delay=0.000,
dispersion=16000.000, jitter=0.002,
filtdelay=     0.00    0.00    0.00    0.00    0.00    0.00      0.00    0.00,
filtoffset=   +0.00   +0.00   +0.00   +0.00   +0.00   +0.00   +0.00   +0.00,
filtdisp=   16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0

我看到闪存状态为1400。1400我无法1400在 ntp 文档中找到闪存状态是什么意思。

更新

它开始工作了。我替换iburst为minpoll 3 maxpoll 4,之后它正在重新启动。我用过这样的游泳池 pool pool.ntp.org minpoll 3 maxpoll 4。我不确定这种变化有什么不同。

我还读到我们应该避免使用 minpoll 和 maxpoll。 Too frequent for a sustained period and public NTP services may block you. ntpd is already good at dynamically selecting the pool interval.

不管怎样,谢谢大家帮助我。

ntp ntpd conf
  • 1 个回答
  • 289 Views
Martin Hope
vivek
Asked: 2021-07-17 08:27:28 +0800 CST

如果我们在 ntp.conf 文件中有多个服务器,则 ntpd 守护进程更喜欢哪个服务器进行时间同步

  • 0

我读到ntp使用所有服务器进行时间同步。它给了我一个问题。假设我在ntp.conf文件中有多个服务器,并且时间间隔也超过 1 天。我还没有在ntp.conf文件中指定首选关键字。

server.1 <ip>
server.2 <ip>
server.3 <ip>
server.4 <ip> 

如果我ntpd使用-g选项运行,那么ntp守护程序将更喜欢哪个服务器来填补大的时间间隔?

ntp ntpd
  • 1 个回答
  • 295 Views

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