服务器上的当前时间与实际时间相差 7 分钟

Current time on server is 7 minutes different than actual time

有人知道这是怎么发生的吗?我的服务器比 google 的实时时间慢 7 分钟(与用户 devices/phones 上显示的实时时间相匹配)。

我在 digital ocean.

上使用 Ubuntu 服务器

我怎么休息七分钟?我使用此服务器 运行 已有 4 年多了。我认为这是最近发生的,它导致服务器和终端设备之间的同步出现问题。

编辑:@ 9:39AM CDT 每 Google:

我刚知道 timedatectl。看来我的服务器时间没有同步:

$ timedatectl
Local time: Fri 2018-07-27 14:32:30 UTC
Universal time: Fri 2018-07-27 14:32:30 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

编辑:@ 9:47AM CDT 每 Google:

我刚刚安装了 NTP:

$ sudo apt-get update
$ sudo apt-get install ntp

timedatectl 仍然显示 7 分钟关闭,但显示 NTP 同步:是

$ timedatectl
Local time: Fri 2018-07-27 14:39:38 UTC
Universal time: Fri 2018-07-27 14:39:38 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

编辑:@ 9:50AM CDT 每 Google:

timedatectl 现在显示正确,但又说 NTP 同步:否

$ timedatectl
Local time: Fri 2018-07-27 14:50:12 UTC
Universal time: Fri 2018-07-27 14:50:12 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

人们应该始终使用 NTP 与 NTP 服务器同步时间。

现代Ubuntu推荐chrony for that purpose. I always use ntpd