我使用的是慢速连接(拨号连接),延迟时间很长(+400ms)。我最近收到了一台坏了的 MyBook World,我把它翻新了,并在它上面安装了 Debian。
问题是,该设备没有内置时钟,因此每次启动时日期都会被设置回 1970 年。我本以为可以使用 NTP 解决这个问题,但 NTP 运行一段时间后就会退出,没有错误,时间也一样。我使用的是ntp -q
。
我也尝试过ntpdate-debian
,但出现以下错误:
1 月 1 日 00:14:11 ntpdate[966]: 未找到适合同步的服务器
这是我的ntp.conf:
root@mybook:~# cat /etc/ntp.conf
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
#Belgium
server ntp1.belbone.be iburst dynamic
server ntp2.belbone.be iburst dynamic
#Holland
server ntp3.linocomm.net iburst dynamic
server ntp2.linocomm.net iburst dynamic
server serv01.richs.nl iburst dynamic
server ntp.grafix.nl iburst dynamic
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
root@mybook:~#
如您所见,我也尝试选择地理位置靠近我(比利时)的服务器。
有人可以提供一些帮助吗?
答案1
尝试使用ntpdate
before ntp
。您还可以使用ntpq -c peers
命令查看是否正在连接到服务器。如果可能,我通常使用我的 ISP 时间服务器或 DNS 服务器。看起来您可能正在这样做。这些应该具有良好的连接性和延迟。
ntpdate -d ntp3.linocomm.net
可用于检查连接性。您可以在一个命令中列出所有服务器。删除 -d 以设置时间。