我的时钟关闭了,所以我想使用进行同步ntpdate。我尝试了几种不同的NTP服务器,但是由于某种原因,我总是收到以下错误消息:
$ sudo ntpdate ntp.ubuntu.com
4 Mar 12:27:35 ntpdate[1258]: no server suitable for synchronization found
$ sudo ntpdate pool.ntp.org
4 Mar 12:27:50 ntpdate[1267]: no server suitable for synchronization found
$ sudo ntpdate de.pool.ntp.org
4 Mar 12:28:01 ntpdate[1273]: no server suitable for synchronization found
$ sudo ntpdate us.pool.ntp.org
4 Mar 12:28:12 ntpdate[1276]: no server suitable for synchronization found
相关问题
我已经浏览了相关问题,但没有一个能解决我的问题:
- 无法使用NTP同步时间 -这个家伙收到的错误与我不同;他的问题是与
ntpd守护程序发生冲突。我根本没有安装ntp软件包(包括ntpd守护程序)。 - 如何使用ntp强制更新时钟?-这个人的问题在于,当该
ntpdate命令放入引导程序时,该命令在引导时将无法正常工作/etc/rc.local,并且问题同样与ntpd正在运行的守护程序发生冲突。我既没有尝试ntpdate在引导时运行,也没有(同样)没有ntpd安装守护程序。 - 无法使用`ntpdate`同步时间,错误:“找不到适合同步的服务器” -这是我的错误,但是可接受的答案基本上是“使用
ntpd而不是ntpdate”。Aaarggh ...
我尝试过的事情
我安装了ntp软件包
...并尝试使用ntpd守护程序代替ntpdate实用程序。它也不会同步我的时间;守护程序启动正常,但我的时钟保持关闭状态。我什至尝试使用/etc/ntp.conf后一篇文章中接受的答案中的确切信息,然后重新启动守护程序。不行 无论如何,我不想使用守护程序。我完全知道它ntpdate已被“弃用”,建议改为使用ntpd -q。另请参阅此处:
但是既然ntpd也不适合我,问题就出在其他地方。而且我发现我宁愿不必为了同步时钟而安装任何额外的软件包。ntpdate预先安装了Ubuntu,它应该可以正常工作。因此,我ntp再次卸载了该软件包。
也许123端口被阻塞了?
从这篇文章:
...我的想法是,在工作场所,端口123可能被我的计算机/网络阻止了。确实,
$ sudo nmap -p123 -sU -P0 localhost
...
PORT STATE SERVICE
123/udp closed ntp
...
$ sudo ufw allow 123/udp
Rules updated
Rules updated (v6)
$ sudo nmap -p123 -sU -P0 localhost
...
PORT STATE SERVICE
123/udp open ntp
...
但仍然:
$ sudo ntpdate ntp.ubuntu.com
4 Mar 13:06:16 ntpdate[4361]: no server suitable for synchronization found
即使使用该-u选项,该选项也ntpdate可以使用未特权的端口进行同步(而不是port 123),但该端口肯定不受我的工作场所的限制:
$ sudo ntpdate -u ntp.ubuntu.com
4 Mar 13:06:28 ntpdate[4427]: no server suitable for synchronization found
也许地层太高了?
最后,来自serverfault的这篇文章:
...我认为也许来自NTP服务器的层次过高。不过不是。让我们看看更多的调试信息:
$ sudo ntpdate -dv ntp.ubuntu.com
4 Mar 13:12:24 ntpdate[4523]: ntpdate 4.2.6p5@1.2349-o Wed Oct 9 19:08:07 UTC 2013 (1)
Looking for host ntp.ubuntu.com and service ntp
host found : golem.canonical.com
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
91.189.89.199: Server dropped: no data
91.189.94.4: Server dropped: no data
server 91.189.89.199, port 123
stratum 0, precision 0, leap 00, trust 000
refid [91.189.89.199], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
originate timestamp: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
transmit timestamp: d6c041ae.e6166441 Tue, Mar 4 2014 13:12:30.898
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
server 91.189.94.4, port 123
stratum 0, precision 0, leap 00, trust 000
refid [91.189.94.4], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
originate timestamp: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
transmit timestamp: d6c041af.1948fc50 Tue, Mar 4 2014 13:12:31.098
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
4 Mar 13:12:33 ntpdate[4523]: no server suitable for synchronization found
Pfeeewww ...这很长,对此表示歉意。我很沮丧 有什么线索吗?
更新:其他信息
无论NTP服务器HOSTNAME的数字中/etc/ntp.conf,而不管是否ntpd服务运行与否,每当我跑sudo ntpdate -u HOSTNAME,我得到no server suitable for synchronization found。当ntpd服务未运行时,同样的事情,我省略了该-u选项。当ntpd服务正在运行,我省略了-u选择,我反而得到the NTP socket is in use, exiting。
也:
$ timedatectl status
Local time: Wed 2014-03-05 13:11:54 CET
Universal time: Wed 2014-03-05 12:11:54 UTC
Timezone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2013-10-27 02:59:59 CEST
Sun 2013-10-27 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2014-03-30 01:59:59 CET
Sun 2014-03-30 03:00:00 CEST
但是,此处的UTC时间不正确。现在,UTC时间现在11:11不是12:11。
和:
$ sudo hwclock --show
Wed 05 Mar 2014 01:11:56 PM CET -0.625627 seconds
server pool.ntp.org到/etc/ntp.conf,但ntpdate -u pool.ntp.org引发了相同的错误。我还尝试了ntp.ubuntu.com(将其添加到/etc/ntp.conf,重新启动ntp服务,ntpdate -u在我刚刚添加到的确切服务器上重新运行/etc/ntp.conf)。总结一下,我要与之同步的服务器是否在中都没有关系/etc/ntp.conf。no server suitable...在所有情况下,我都会收到错误消息(除非ntp服务正在运行,并且我省略了该-u选项,然后我收到了NTP socket in use错误消息)。
sudo ntpdate 0.ubuntu.pool.ntp.org,该/etc/ntp.conf文件中已经存在。没有运气-同样的错误。



ntp.ubuntu.com到/etc/ntp.confs服务器字段后是否这样做了 ?如果没有看到以下答案