当前位置: 首页 > news >正文

由时间服务器产生的一个误会(by quqi99)

作者:张华 发表于:2026-07-23
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明

自从我换老板之后,我感觉我每次都是准时参会的,但我老板总喜欢ping我,原来全是时间服务器惹得祸。我发现mattermost和我的手机上的时间都比我本地电脑的时间快一分钟,而我是看着本地电脑的时间准时参会的,所以我每次会比别人晚一分钟,所以误会就产生了。

1, The automatic time synchronization has been turned on, but the time synchronization was not successful (System clock synchronized: no)

hua@y9000p:~$ timedatectl status Local time: 四 2026-07-23 10:15:40 CST Universal time: 四 2026-07-23 02:15:40 UTC RTC time: 四 2026-07-23 02:15:14 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: no NTP service: active RTC in local TZ: no

2, My machine does not have an IPv6 address, but ntp.ubuntu.com is using an IPv6 address (2620:2d:4000:1::3f)

hua@y9000p:~$ timedatectl timesync-status Server: 2620:2d:4000:1::3f (ntp.ubuntu.com) Poll interval: 34min 8s (min: 32s; max 34min 8s) Packet count: 0 hua@y9000p:~$ ip -6 route get 2620:2d:4000:1::3f RTNETLINK answers: Network is unreachable hua@y9000p:~$ ip addr show wlp130s0f0 3: wlp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 98:fe:3e:20:6a:d4 brd ff:ff:ff:ff:ff:ff inet 192.168.3.130/24 brd 192.168.3.255 scope global dynamic noprefixroute wlp130s0f0 valid_lft 552060sec preferred_lft 552060sec inet6 fe80::300:c64:a190:e6ee/64 scope link noprefixroute valid_lft forever preferred_lft forever

3, It should be because ntp.ubuntu.com timed out when using an IPv4 address, so it switched to using an IPv6 address.

hua@y9000p:~$ journalctl -u systemd-timesyncd -b --no-pager |grep -i 'timed out' |wc -l 2584 hua@y9000p:~$ journalctl -u systemd-timesyncd -b --no-pager |grep -i 'timed out' |tail -n1 7月 23 09:58:32 y9000p systemd-timesyncd[1792]: Timed out waiting for reply from 185.125.190.58:123 (ntp.ubuntu.com). hua@y9000p:~$ resolvectl query ntp.ubuntu.com ntp.ubuntu.com: 2620:2d:4000:1::41 -- link: wlp130s0f0 2620:2d:4000:1::40 -- link: wlp130s0f0 2620:2d:4000:1::3f -- link: wlp130s0f0 91.189.91.157 -- link: wlp130s0f0 185.125.190.58 -- link: wlp130s0f0 185.125.190.57 -- link: wlp130s0f0 185.125.190.56 -- link: wlp130s0f0

4, But this command (nc -vzu ntp.ubuntu.com 123) is successful now.

hua@y9000p:~$ nc -vzu ntp.ubuntu.com 123 Connection to ntp.ubuntu.com (185.125.190.58) 123 port [udp/ntp] succeeded!

5, After adding the domain ntp.ubuntu.com into whitelist in my router

hua@y9000p:~$ journalctl -u systemd-timesyncd -b --no-pager -f ... 7月 23 09:58:32 y9000p systemd-timesyncd[1792]: Timed out waiting for reply from 185.125.190.58:123 (ntp.ubuntu.com). 7月 23 10:34:01 y9000p systemd-timesyncd[1792]: Contacted time server 185.125.190.58:123 (ntp.ubuntu.com). 7月 23 10:34:01 y9000p systemd-timesyncd[1792]: Initial clock synchronization to Thu 2026-07-23 10:34:01.939524 CST.

6, Maybe I can also use the following configuration instead.

sudo timedatectl set-timezone Asia/Shanghai sudo sed -i 's/#RootDistanceMaxSec=5/RootDistanceMaxSec=999999999/' /etc/systemd/timesyncd.conf sudo sed -i 's/#NTP=/NTP=ntp.aliyun.com/' /etc/systemd/timesyncd.conf systemctl restart systemd-timesyncd
http://www.jsqmd.com/news/1252076/

相关文章:

  • [Git/版本控制] 告别合错分支与遗漏打标噩梦!Git Tag 标签管理与 Merge 错误回滚工程实战
  • HarmonyOS 应用开发《掌上英语》第39篇:页面参数传递从简单字符串到复杂对象的序列化
  • 2026年7月兰州牛肉拉面馆招商/兰州特色牛肉拉面加盟品牌合作怎么联系_甘肃观蘭餐饮管理有限公司 - 品牌宣传支持者
  • 计算机二级WPS表格操作:评分逻辑与考试技巧详解
  • PaddleOCR版面分析数据集制作与优化实战
  • AI代码生成代理的技术架构与多语言实现对比
  • Win11临时文件清理全攻略:释放C盘空间
  • 合同审查的重复劳动,AI一来直接让你解放
  • 苏州小规模企业频繁开票,怎样做好财税风险管控?
  • 智能体与AI大模型入门指南:核心概念与实战路径
  • 计算机二级WPS演示文稿7大核心考点解析与实战技巧
  • 项目经理的核心能力:从计划到有效跟进的跨越
  • 商业级ARPG开发:从领域驱动到数据驱动的工程化实战
  • C++零基础入门实战:从核心语法到项目开发全解析
  • 为技术极客打造的Linux发行版:深度定制与极致掌控
  • MCP 协议实战指南:2026 年 AI 开发者必备的工具链集成标准
  • 2026年7月兰州清汤牛肉面加盟/兰州特色牛肉面加盟品牌有哪些_甘肃观蘭餐饮管理有限公司 - 行业平台推荐
  • 入圈三年,我总结了一条最值钱的铁律:凡是让你“抓紧上车”的,基本都是想让你“赶紧下车”
  • 谷歌AI攻克6道世界级数学难题的技术解析
  • Elasticsearch使用
  • 中小团队AI落地真相:不靠GPU集群,用3台服务器+Kubernetes+量化模型实现日均10万次稳定推理(附拓扑图)
  • VLA模型在想象中训练的强化学习新范式解析
  • 太仓实体商家做线上推广,GEO 落地经验总结
  • 从“点点点”到自动化:2026秋招测试岗技能清单,你缺哪一项?
  • 2026仓储推拉棚选购指南:这3步帮你避坑
  • 基于MSP430与bq电量计的宽输入智能充电器设计实战
  • Windows系统cmstplua.dll缺失的修复与预防指南
  • 变分自编码器(VAE)原理与实战:从生成模型到工业部署
  • OpenCV与Qt实现工业级视觉定位抓取系统开发
  • AI生成内容优化实战:提升简历与作品集通过率