我需要永久同步我的服务器 NTP 与亚马逊的 AWS 服务器的 NTP,这样我对其服务器的请求就不会出错。我可以通过对我的ntp.conf
文件进行以下编辑(暂时)做到这一点:
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
server 0.amazon.pool.ntp.org iburst
server 1.amazon.pool.ntp.org iburst
server 2.amazon.pool.ntp.org iburst
server 3.amazon.pool.ntp.org iburst
现在,重新加载我的系统并比较亚马逊服务器时间和我的服务器时间后,一切成功:
vagrant@homestead:~$ curl http://s3.amazonaws.com -v
* Connected to s3.amazonaws.com port 80 (#0)
> GET / HTTP/1.1
> Host: s3.amazonaws.com
< Date: Wed, 23 May 2018 04:53:06 GMT
< Location: https://aws.amazon.com/s3/
vagrant@homestead:~$ timedatectl status
Local time: Wed 2018-05-23 04:54:04 GMT
Universal time: Wed 2018-05-23 04:54:04 UTC
RTC time: Wed 2018-05-23 04:54:02
Time zone: Etc/GMT (GMT, +0000)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
然而,大约半小时后,timedatectl
再次检查后,该NTP synchronized
参数变为“是”,并且再次完全打乱我的时间……我怎样才能永久停止这种情况?