systemd-timesyncd:超时

systemd-timesyncd:超时

我正在努力同步 Pop OS 21.04 上的系统时钟。

我读过很多关于这个主题的帖子,但似乎没有帮助。

我的系统时钟不同步,这导致加载某些资源(例如gitlab)时出现问题

$ timedatectl 
               Local time: Sat 2021-10-09 23:02:20 CEST
           Universal time: Sat 2021-10-09 21:02:20 UTC
                 RTC time: Sat 2021-10-09 21:02:21
                Time zone: Europe/Madrid (CEST, +0200)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

我的 timesyncd.conf 如下所示

[Time]
NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org
FallbackNTP=ntp.ubuntu.com
RootDistanceMaxSec=5
PollIntervalMinSec=32
PollIntervalMaxSec=2048

我已经多次更改 NTP 服务器,使用 IP 和不同的服务器,但无论我做什么,我总是得到以下结果:

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-10-09 22:42:10 CEST; 23min ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 9955 (systemd-timesyn)
     Status: "Connecting to time server 162.159.200.123:123 (1.pool.ntp.org)."
      Tasks: 2 (limit: 37919)
     Memory: 1.1M
     CGroup: /system.slice/systemd-timesyncd.service
             └─9955 /lib/systemd/systemd-timesyncd

Oct 09 22:55:08 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 69.164.213.136:123 (0.pool.ntp.org).
Oct 09 22:55:18 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 82.64.172.48:123 (0.pool.ntp.org).
Oct 09 22:55:29 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 85.25.128.62:123 (0.pool.ntp.org).
Oct 09 22:55:39 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 216.197.228.230:123 (0.pool.ntp.org).
Oct 09 22:55:49 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 185.132.136.116:123 (1.pool.ntp.org).
Oct 09 22:55:59 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 5.56.160.3:123 (1.pool.ntp.org).
Oct 09 22:56:10 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 162.159.200.123:123 (2.pool.ntp.org).
Oct 09 22:56:20 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 185.18.52.78:123 (2.pool.ntp.org).
Oct 09 23:05:02 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 51.38.162.10:123 (0.pool.ntp.org).
Oct 09 23:05:13 pop-os systemd-timesyncd[9955]: Timed out waiting for reply from 90.165.120.190:123 (0.pool.ntp.org).

AFAIK它使用123 udp端口发送请求,我没有任何防火墙,看起来它是可以访问的

$ nc -vzu 0.pool.ntp.org 123
Connection to 0.pool.ntp.org (90.165.120.190) 123 port [udp/ntp] succeeded!

关于如何同步系统时钟有任何帮助吗?

答案1

我的 ntp 服务器没有响应也遇到了同样的问题。我正在使用 chronyd。我读到了“您需要向 chrony.conf 文件添加一个允许指令,以便 chronyd 打开服务器 NTP 端口并响应客户端请求”。在https://chrony.tuxfamily.org/faq.html

echo "allow" >> /etc/chrony/chrony.conf

我的现在可以用了

相关内容