我试图修复错误RequestTimeTooSkewed我在尝试将项目部署到亚马逊服务器时得到了我发现这篇文章。
use the same workarounds as for system classes
我正在遵循这些步骤,但仍然坚持重新启动ntp服务。
我使用service.ntpd restart
命令但是我收到错误
Failed to restart ntpd.service: Unit ntpd.service not found.
我该如何解决这个问题?
答案 0 :(得分:1)
尝试
$ systemctl start ntpd
如果这不起作用,可能没有安装ntp。尝试先安装它。
$ sudo yum install ntp
答案 1 :(得分:0)
虽然这不能解决你的ntpd问题,但是here是与ubuntu上的npd时间同步的一些相关文档,可能对某些人有所帮助。
这里的关键部分是:
在最近的Ubuntu版本中,timesyncd替换了ntpd的客户端部分。默认情况下,timesyncd会定期检查并保持时间同步。它还在本地存储时间更新,以便在重新启动后单调提升(如果适用)。
可以使用timedatectl状态检查通过timedatectl和timesyncd配置的时间和时间的当前状态。
总结:如果timedatectl status
显示Network time on: yes
,那么您的系统已经配置为以与ntp
相似的方式使用ntpd
。这应该是“最近的”ubuntu版本的默认行为(在16.04中确认)。
答案 2 :(得分:0)
在Ubuntu上,ntpd的服务名称是ntp,而不是ntpd。 所以尝试
$ sudo service ntp restart
或等效地
$ sudo systemctl restart ntp
答案 3 :(得分:0)
以下内容对我有用。
$ apt install ntpdate
$ apt install ntp
$ ntpdate -u "in.pool.ntp.org"
$ sudo service ntp restart
注意:用您所在国家/地区提供的ntp服务器替换服务器URL“ in.pool.net.org”。
答案 4 :(得分:0)
让您的虚拟操作系统机器在桥接适配器上运行,然后尝试 -
第一次运行 -> yum install ntp 然后运行
systemctl 启动 ntpd