NTP 时间同步

NTP 的概念

当前阶层 0 以铯喷泉钟或者铷原子钟作为时钟源是最靠谱的。其次是氢原子钟或者石英晶体谐振器作为时钟源。

推荐用 systemd-timesyncd 或者 Chrony 来同步时间。

systemd-timesyncd

systemd-timesyncd 是 systemd 的一个服务,提供轻量级的时间同步功能。

配置文件 /etc/systemd/timesyncd.conf

NTP 服务

排名有先后。

  • 阿里云: https://help.aliyun.com/document_detail/92704.html
  • 苹果: time.asia.apple.com
    • 查看你的 Mac 里的文件 /etc/ntp.conf 获知该地址
  • 国际民用: https://www.ntppool.org/zh/use.html
  • 国家授时中心: ntp.ntsc.ac.cn
    • 出处,然而据说国家授时中心的 NTP 很不靠谱。(应该是真的不靠谱,2018 年的这个链接都被特意删除了)
  • 其他: https://dns.icoa.cn/ntp/

Mac 无法使用 ntpq

ntpq -q 显示 ntpq: read: Connection refused

MacOS 使用自己的 timed 程序和 DAS 系统来代替 NTP 实现时间同步。具体看 man timed 里的描述。

参考这篇文章

参考资料