Windows-Server-2008

帶有 Linux 客戶端的 Windows NTP 伺服器

  • October 23, 2020

有沒有人有過將 Linux(特別是 Red Hat)同步到 Windows NTP 伺服器的經驗?目前,我們的 Windows 伺服器正在與 Internet 上的第 1 層伺服器同步,但 Linux 機器拒絕承認它是一個好的時間源。

經過一些研究,我們的問題似乎是 Root Dispersion 值可能太高了。這是 ntpq 的輸出 -

ntpq> peers
    remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================  
ntp1.ourdomain   10.10.10.1       4 u   20  128  377    0.376  1397.10  22.800

ntpq> ass

ind assID status  conf reach auth condition  last_event cnt
===========================================================
 1 30939  90b4   yes   yes  none    reject   reachable 11
ntpq> rv 30939
assID=30939 status=90b4 reach, conf, 11 events, event_reach,
srcadr=ntp1.ourdomain.com, srcport=123, dstadr=10.10.10.2,
dstport=123, leap=00, stratum=4, precision=-6, rootdelay=93.750,
rootdispersion=2333.466, refid=10.10.10.1, reach=377, unreach=0, hmode=3,
pmode=4, hpoll=7, ppoll=7, flash=400 peer_dist, keyid=0, ttl=0,
offset=1369.793, delay=0.000, dispersion=21.915, jitter=15.387,
reftime=d7493cd7.fd3528d6  Mon, Jun 16 2014 10:52:23.989,
org=d74944eb.b857f9bc  Mon, Jun 16 2014 11:26:51.720,
rec=d74944ea.5709a581  Mon, Jun 16 2014 11:26:50.339,
xmt=d74944ea.56ea01a7  Mon, Jun 16 2014 11:26:50.339,
filtdelay=     0.48    0.51    0.00    0.43    0.50    0.44    0.40    0.55,
filtoffset= 1380.34 1376.38 1369.79 1362.68 1360.75 1353.16 1349.80 1343.46,
filtdisp=     15.63   17.58   19.48   21.42   23.37   25.30   27.25   29.20

我想了解的是為什麼這個值如此之高,我們可以在 Windows 伺服器上配置什麼來改變它。

更新

這是來自我們的 Windows NTP 伺服器的一些資訊 -

c:\Windows\System32>w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 2 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0312500s
Root Dispersion: 1.2097655s
ReferenceId: 0x9E2BC042 (source IP:  158.43.192.66)
Last Successful Sync Time: 18/06/2014 04:41:16
Source: ntp2.pipex.net
Poll Interval: 15 (32768s)


c:\Windows\System32>w32tm /query /peers
#Peers: 2

Peer: ntp1.pipex.net
State: Active
Time Remaining: 6264.1144284s
Mode: 1 (Symmetric Active)
Stratum: 2 (secondary reference - syncd by (S)NTP)
PeerPoll Interval: 15 (32768s)
HostPoll Interval: 15 (32768s)

Peer: ntp2.pipex.net
State: Active
Time Remaining: 6264.1144284s
Mode: 1 (Symmetric Active)
Stratum: 1 (primary reference - syncd by radio clock)
PeerPoll Interval: 15 (32768s)
HostPoll Interval: 15 (32768s)

如果 ntpd 由於偏移量大而斷定遠端時鐘出現問題,它將拒絕時鐘。您的 linux 機器很可能拒絕 Windows TS,因為偏移量高於恐慌門檻值。假設 Windows 時間伺服器正常工作,您應該考慮將-g標誌添加到 ntpd 呼叫:

-g Normally, ntpd exits with a message to the system log if
  the offset exceeds the panic threshold, which is 1000 s by
  default.  This option allows the time to be set to any value
  without restriction; however, this can happen only once.  If the
  threshold is exceeded after that, ntpd will exit with a message
  to the system log.  This option can be used with the -q and -x
  options.

或將panic值設置為更高或為零:

panic panic
   Specifies the panic threshold in seconds with default 1000 s. If set to
   zero, the panic sanity check is disabled and a clock offset of any value
   will be accepted.

僅供參考:尚不清楚您的 Windows 時間安裝是否正常工作和/或按照您描述的方式進行配置。您提到 Windows 伺服器正在與 Internet 上的第 1 層機器同步。但是,您的同行廣告牌顯示 ntp1.ourdomain 位於第四層:

Stratum  Machine description
1        ntp ref clock on internet
2        ?????????
3        ?????????
4        ntp1.ourdomain
5        linux boxes

對於具有如此低延遲的機器來說,抖動值也非常高,我假設這表示同一本地網路上的機器。

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