win:

  1. 运行--services.msc, 开启windows time 自启动。

  2. 更改日期和时间设置--internet 时间-更改设置,选择服务器,windows默认的时间服务器为time.windows.com ,这个经常出问题,我们可以选择 time.nist.org 这台服务器,

  3. 点击立即更新,确定即可

linux:

  1. 一般通用的做法是通过定时任务实现,可直接修改vim /var/spool/cron/root(等同crontab -e),

  2. */5 * * * * /usr/sbin/ntpdate time.asia.apple >/dev/null >2>&1

  3. 保存退出即可。