首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu服务器:找不到适合同步的服务器

Ubuntu服务器:找不到适合同步的服务器
EN

Unix & Linux用户
提问于 2019-07-03 15:32:50
回答 1查看 8.4K关注 0票数 1

我正在同步4 Raspberry Pi时钟与一个Ubuntu服务器(全部在一个本地网络,通过以太网连接),使用NTP。所有设备都是脱机的,因此服务器只监听其本地时钟;实时并不重要。当我重新启动主机并启动NTP服务器时,客户端不能同步几分钟:命令

代码语言:javascript
复制
sudo ntpdate NTP-server-host

抛出错误:

6月18日18:42:55 ntpdate一千五四六:没有适合同步的服务器

(NTP-服务器-主机对应于服务器的ip )工作了几分钟后。只有在重新启动之后才会发生这种情况。可能是什么原因?服务器正在运行,防火墙端口被打开。

服务器上的

ntp.conf:

代码语言:javascript
复制
driftfile /var/lib/ntp/ntp.drift

# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list

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

server 127.127.1.0
fudge 127.127.1.0 stratum 10

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Needed for adding pool entries
restrict source notrap nomodify noquery

客户端的

ntp.conf:

代码语言:javascript
复制
driftfile /var/lib/ntp/ntp.drift

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


# 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>
pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Needed for adding pool entries
restrict source notrap nomodify noquery

# Use specified ntp server
server NTP-server-host prefer iburst

我只修改了ntp.conf文件,没有完全理解它们。如果有更深层次的人能向我展示其中的错误,那将是令人惊奇的。谢谢!

EN

回答 1

Unix & Linux用户

发布于 2019-07-03 16:55:18

这是完全正常的。NTP需要几个周期来稳定和开始服务时间。客户端部分还需要几个周期来接受服务器是稳定的,并且能够提供时间。

您可以通过运行以下命令来查看Ubuntu服务器的运行情况

代码语言:javascript
复制
ntpq -pn

我还建议您从客户端的配置中删除池服务器,因为您说您的所有系统都脱机运行。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/528236

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档