2013-08-31 17:03:46 +0000 2013-08-31 17:03:46 +0000
75
75
Advertisement

更新时间 : ntpdate[3108]: NTP套接字正在使用中,退出。

Advertisement

我的系统上的时间因为某些原因不正确。
我需要运行更新,但我似乎不能 这就是错误。

ntpdate pool.ntp.org
31 Aug 12:31:59 ntpdate[3108]: the NTP socket is in use, exiting

我刚刚重启,我不知道怎么会出现in use

Advertisement
Advertisement

答案 (4)

155
155
155
2013-09-01 14:29:14 +0000

如果你想在ntpdate守护进程已经启动并运行的情况下执行ntp,请使用以下命令。

# ntpdate -u pool.ntp.org

它将使用不同的端口。

76
76
76
2013-08-31 17:07:43 +0000

它在使用中是因为ntp服务可能在运行。你没有提到你使用的是哪种 Linux,所以假设你已经安装了 service (你运行的是 System V 系统):

$ sudo ntpdate pool.ntp.org
31 Aug 19:05:55 ntpdate[8911]: the NTP socket is in use, exiting
$ sudo service ntp stop
[ok] Stopping NTP server: ntpd.
$ sudo ntpdate pool.ntp.org
31 Aug 19:07:11 ntpdate[10355]: adjust time server 46.29.176.115 offset -0.002893 sec
$ sudo service ntp start
```。
2
Advertisement
2
2
2017-02-16 19:25:28 +0000
Advertisement

简单的一句话来同步你的时钟:

ntpdate -u ptbtime1.ptb.de && hwclock -w
```。
0
0
0
2018-03-24 11:28:14 +0000

你可能有一个防火墙屏蔽了123端口,这可能会导致ntp服务器永远看不到时间服务器。

在我的情况下,我的ISP(互联网服务提供商)封锁了端口。

端口扫描123也没有检测到阻塞。

烟枪是我暂时有两个独立的网络信号。在linux中,如果我运行ntpq -p(重复),第一个网络源被连接上,就不会有任何更新,但另一个源却有更新。

正如 @Jens A. Koch 所说,ntpdate -u <server name> 确实可以解决这个问题,嗯,暂时的(没有双关语的意思),但它不能长期解决时间问题。

随着时间的推移,你的系统和硬件时钟都会发生漂移。在我的例子中,linux/windows双启动也会导致硬件时钟进一步混乱(以小时为单位)。

所以你必须为UDP打开123端口以维持系统时钟。


比起使用-u,你也可以这样做,我认为使用123端口(而不是一个非 “特权 "端口):

service ntp stop,然后是 ntpdate <server url>(没有-u),最后是 service ntp start

这似乎可以绕过端口阻塞的问题,至少可以设置一次时钟。如果-u能用,但这个不能用,那么很肯定的是,端口被阻塞了,或者服务器没有响应,……。


我必须解决的另一个问题是,对我来说,Debian默认的/etc/ntp.conf配置包括4行到池。debian.pool.ntp.org. 这些服务器都没有工作。我得到了这个错误信息。

错误解析 debian.pool.ntp.org: No address associated with hostname (-5) 24 Mar 04:49:27 ntpdate[15115]: 找不到主机 debian.pool.ntp.org。No address associated with hostname (-5) 24 Mar 04:49:27 ntpdate[15115]: no servers can be used, exiting

I had to change the servers to us.pool.ntp.org.

Advertisement

相关问题

6
10
5
37
8
Advertisement