Ntp

ntpd 無法同步 TIME_ERROR: 0x41: 時鐘未同步

  • January 7, 2021

在 Debian 10 上,ntpd 4.2.8p12@1.3728-o無法同步並出現以下錯誤:

kernel reports TIME_ERROR: 0x41: Clock Unsynchronize

這是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

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

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

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

知道有什麼問題嗎?

您的時鐘同步正常。在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/

引用自:https://serverfault.com/questions/1048870