ntpd 无法同步 TIME_ERROR:0x41:时钟不同步

Tom*_*art 3 ntp ntpd

在 Debian 10 上,ntpd 4.2.8p12@1.3728-o无法同步并出现以下错误:

kernel reports TIME_ERROR: 0x41: Clock Unsynchronize
Run Code Online (Sandbox Code Playgroud)

这是ntp.conf

disable monitor

statsdir /var/log/ntpstats

restrict -4 default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

server   127.127.1.0
fudge    127.127.1.0 stratum 10
restrict 127.127.1.0

driftfile /var/lib/ntp/drift

Run Code Online (Sandbox Code Playgroud)

ntpq -c sysinfo:

associd=0 status=0614 leap_none, sync_ntp, 1 event, freq_mode,
system peer:        50-205-57-38-static.hfc.comcastbusiness.net:123
system peer mode:   client
leap indicator:     00
stratum:            2
log2 precision:     -23
root delay:         70.634
root dispersion:    3.569
reference ID:       50.205.57.38
reference time:     e3a0c049.c39d770a  Wed, Jan  6 2021 23:03:37.764
system jitter:      0.723169
clock jitter:       1.177
clock wander:       0.000
broadcast delay:    -50.000
symm. auth. delay:  0.000
Run Code Online (Sandbox Code Playgroud)

ntpq -c lpeers:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        .LOCL.          10 l  286   64   20    0.000    0.000   0.000
*50-205-57-38-st .GPS.            1 u   19   64   37   70.631    1.618   1.843
-ns1.backplanedn 173.162.192.156  2 u   14   64   37   84.235   -1.575   2.852
+c-73-239-136-18 74.6.168.73      3 u   11   64   37   48.606    1.598   2.522
+time-d.bbnx.net 252.74.143.178   2 u   14   64   37   92.632    0.623   0.799

Run Code Online (Sandbox Code Playgroud)

timedatectl:

               Local time: Wed 2021-01-06 23:06:44 UTC
           Universal time: Wed 2021-01-06 23:06:44 UTC
                 RTC time: Wed 2021-01-06 23:06:44
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

Run Code Online (Sandbox Code Playgroud)

知道可能出什么问题吗?

Pau*_*ear 9

您的时钟同步正常。sync_ntp你的证明了这一点ntpq -c sysinfo。您所指的内核消息在ntpd启动过程中是暂时的,无需担心。

我在您的设置中发现的问题:

  1. timedatectl未正确报告时间同步。解决这个问题的简单方法是不运行它。:-) 在我的一台具有相同操作系统和 NTP 版本的服务器上,timedatectl根本不会产生任何有用的东西,而是说Failed to create bus connection: No such file or directory, 因为我不运行dbus.
  2. 我很惊讶你的配置竟然可以与池服务器一起使用,因为缺少一条restrict source ...线路。
  3. 您正在使用 LOCL 时钟驱动程序,该驱动程序已被弃用多年。
  4. 同样,您无需disable monitor保护自己不被用于反射式 DDoS - 默认restrict线路可以处理该问题。

您应该恢复到默认的 Debian/etc/ntp.conf内容 - 它会比您当前的配置工作得更好,并且在升级时会减少问题。这是一份副本,以防您手头没有副本:http ://paste.debian.net/1180011/