尽管具有更好的偏移和抖动,但优选的NTP服务器被拒绝

时间:2018-03-28 05:49:51

标签: ntp ntpd

我们在其中一个系统上配置了NTP客户端。 客户端有一组可与之同步的服务器。

但是,我们选择的首选服务器是内部主服务器,IP 169.254.1.51。

ntp.conf的内容如下: -

 

    # --- CLIENT NETWORK -------
    # --- USER SETTINGS BEGIN ---

    server 10.241.34.2 iburst

    server 10.241.34.3 iburst

    server 10.241.34.4 iburst
    restrict 10.241.34.2  mask 255.255.255.255 nomodify notrap noquery
    restrict 10.241.34.3  mask 255.255.255.255 nomodify notrap noquery
    restrict 10.241.34.4  mask 255.255.255.255 nomodify notrap noquery
    # --- USER SETTINGS END ---

    # --- NTP MULTICASTCLIENT ---
    restrict 169.254.0.0 mask 255.255.0.0 nomodify notrap  # internal network
    # --- INTERNAL TIMESERVERS BEGIN-----
    server 169.254.1.51 burst iburst minpoll 4 maxpoll 6 prefer #Internal master Server

    # --- GENERAL CONFIGURATION ---
    server  127.127.1.0 iburst minpoll 4    # local clock
    fudge   127.127.1.0 stratum 10
    tinker step 0

以上是配置部分。 但是,当我们在配置并重新启动系统后检查syslog时,我们发现客户端正在与外部服务器同步而不是在syslog中的ntpq输出中捕获的prefer服务器


    Mar 22 05:52:48 Node ntpcheck:      remote           refid      st t when poll reach   delay   offset  jitter
    Mar 22 05:52:48 Node ntpcheck: ==============================================================================
    Mar 22 05:52:48 Node ntpcheck: *10.241.34.2     10.240.33.1      4 u    2   64    1    0.192  -519.50   5.769
    Mar 22 05:52:48 Node ntpcheck:  10.241.34.3     10.241.34.2      5 u    1   64    1    0.172  -523.79   8.912
    Mar 22 05:52:48 Node ntpcheck:  10.241.34.4     10.241.34.2      5 u    2   64    1    0.207  -520.73   8.082
    Mar 22 05:52:48 Node ntpcheck:  169.254.1.51    LOCAL(0)        11 u    1   16    1    0.113   -0.043   2.099
    Mar 22 05:52:48 Node ntpcheck:  127.127.1.0     .LOCL.          10 l   14   16    1    0.000    0.000   0.001}

此外,以下消息消息在syslog中持续泛滥


    Mar 22 06:51:11 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:51:27 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:51:45 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:52:03 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:52:20 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:52:35 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:52:51 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:53:06 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:53:20 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:53:23 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:53:38 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:53:53 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:54:11 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:54:29 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:54:47 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:55:02 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:55:20 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:55:21 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:55:35 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:55:53 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:56:10 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:56:28 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:56:46 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:57:03 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:57:21 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:57:38 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:57:54 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:58:09 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:58:24 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:58:42 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:58:59 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:59:15 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 06:59:30 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 06:59:46 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4
    Mar 22 07:00:02 Node ntpd[31292]: synchronized to LOCAL(0), stratum 10
    Mar 22 07:00:17 Node ntpd[31292]: synchronized to 10.241.34.2, stratum 4

我们尝试检查NTP论坛,并确定它在定义要与之同步的服务器时使用以下参数 (参考: - https://www.eecis.udel.edu/~mills/ntp/html/warp.html): -

  • 第一级拒绝是基于偏移和延迟而发生的。
  • 然后在拒绝池之后,幸存者被传递给时钟聚类算法。
  • 聚类算法取决于抖动来决定。
  • 剩下的所有服务器都是可选择的幸存者,可以选择其中任何一个。
  • 现在,prefer关键字的作用开始发挥作用,并且所有可选择的选项都会被选中,而选择一个则会被选中。
  • 如果幸存者不在场,则迁移规则决定同伴。

然而,在ntpq输出中,prefer服务器具有更好的偏移和抖动,即使它没有被选中。

在这种情况下,是否有可能确定拒绝首选服务器的依据。

0 个答案:

没有答案