![Ntpd 漂移,速度非常快](https://linux22.com/image/942220/Ntpd%20%E6%BC%82%E7%A7%BB%EF%BC%8C%E9%80%9F%E5%BA%A6%E9%9D%9E%E5%B8%B8%E5%BF%AB.png)
我必须每天运行 stop ntp/ntpdate/start ntp,因为我的笔记本电脑(ThinkPas AMD64 Rhyzen,Ubuntu 20.04)每天会浪费半个小时
这是我的 ntp.conf(几乎是默认的):
driftfile /var/lib/ntp/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server aragorn.groumpf.org iburst
server numenor.groumpf.org iburst
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
restrict 127.0.0.1
restrict ::1
restrict source notrap nomodify noquery
我不是 Linux 新手,但就是看不懂发生了什么
感谢帮助
泽维尔
编辑:所请求的附加信息,时钟刚刚已进行 ntpdate:
[xavier@imladris ~]$ cat /var/lib/ntp/ntp.drift
-0.189
[xavier@imladris ~]$ timedatectl status
Local time: Wed 2021-11-03 08:58:59 CET
Universal time: Wed 2021-11-03 07:58:59 UTC
RTC time: Wed 2021-11-03 08:16:53
Time zone: Europe/Paris (CET, +0100)
System clock synchronized: no
NTP service: n/a
[xavier@imladris ~]$ ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
+176.31.180.205 193.52.184.106 2 u 35 64 1 15.545 309.431 255.807
*192.168.100.144 193.52.184.106 2 u 10 64 3 0.166 490.224 445.668
答案1
我建议您删除ntp
:
sudo apt remove ntp
并安装systemd-timesyncd
(所有新安装都应默认安装):
sudo apt install systemd-timesyncd
之后,检查
systemctl status systemd-timesyncd
“systemd-timesyncd.service”处于“活动(正在运行)”状态,并且
timedatectl status
你应该看到类似这样的内容:
...
System clock synchronized: yes
NTP service: active
...
也可以看看这。
答案2
我最终放弃了ntpd,成功安装了chrony
感谢所有帮助过的人
干杯
泽维尔