CentOS 8 NTP:Chrony 不会与源同步,timedatectl 显示没有同步但 NTP 处于活动状态

CentOS 8 NTP:Chrony 不会与源同步,timedatectl 显示没有同步但 NTP 处于活动状态

过去几个小时我一直在与 Chrony 作斗争,似乎无法弄清楚我做错了什么。我发现在 DNF 中尝试激活 Epel-release 时我的系统时间设置为 2015 年,一些证书错误导致我尝试解决时间日期问题。以下是我所有相关的输出:

    # timedatectl
               Local time: Wed 2021-05-05 16:24:27 EDT
           Universal time: Wed 2021-05-05 20:24:27 UTC
                 RTC time: Wed 2021-05-05 20:24:27
                Time zone: America/Detroit (EDT, -0400)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

我必须手动设置时间,所以这实际上快了一分钟,以便我可以看到它是否正确运行。

# chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? ntp.speculation.org           0   9     0     -     +0ns[   +0ns] +/-    0ns
^? c-73-239-136-185.hsd1.wa>     0   9     0     -     +0ns[   +0ns] +/-    0ns
^? 165.227.106.11                0   9     0     -     +0ns[   +0ns] +/-    0ns
^? x.ns.gin.ntt.net              0   9     0     -     +0ns[   +0ns] +/-    0ns

# chronyc activity
200 OK
5 sources online
0 sources offline
0 sources doing burst (return to online)
0 sources doing burst (return to offline)
0 sources with unknown address

从其他人的资料来看,这似乎不仅不切实际,而且是错误的

# systemctl stop chronyd

# chronyd -q
2021-05-05T20:31:16Z chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
2021-05-05T20:31:16Z Frequency -97.480 +/- 1.274 ppm read from /var/lib/chrony/drift
2021-05-05T20:31:16Z Using right/UTC timezone to obtain leap second data
2021-05-05T20:31:27Z No suitable source for synchronisation
2021-05-05T20:31:27Z chronyd exiting

我甚至不确定从哪里开始解决这个问题,我尝试过运行和不运行防火墙。

# cat /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
server 2.pool.ntp.org iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16

# Serve time even if not synchronized to a time source.
#local stratum 10

# Specify file containing keys for NTP authentication.
keyfile /etc/chrony.keys

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
#log measurements statistics tracking

我已经对我的配置文件进行了大量编辑,我的池可能有点奇怪,但我不确定还要将它们设置为何。在此之前,只有 1 个池指令被我愚蠢地删除而没有备份。

# ntpstat
unsynchronised
poll interval unknown

最后,在朋友的建议下,我使用了 ntpstat,它给了我这个输出..

我尝试过 chronyc makestep 和 refresh,但都没有结果

编辑:更新,我更改了配置,在适用的情况下包括“池”而不是“服务器”,看看是否能解决我的问题。没有成功

相关内容