首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NTP (NTPSec-1.2.2)客户端能够从NTP服务器同步时间,即使服务器没有从候选服务器切换到系统对等端

NTP (NTPSec-1.2.2)客户端能够从NTP服务器同步时间,即使服务器没有从候选服务器切换到系统对等端
EN

Unix & Linux用户
提问于 2023-04-01 13:49:39
回答 1查看 61关注 0票数 0

我有一个NTP设置(客户机-服务器关联),在客户机端,我在ntp.conf中有下面的行(除其他外):

代码语言:javascript
复制
# This should be maxclock 7, but the pool entries count towards maxclock.
tos maxclock 11

# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
tos minclock 4 minsane 3

server <NTP server IP addr>

因为,我只提供了一个NTP服务器&因为minsane值是3,所以选择服务器作为时钟选择算法的候选,但没有成为系统对等点。然而,我看到,时间仍然是同步的,最终在某个时候。我无法理解这种行为。我将客户端的时间延迟了30秒&同步花费了4+几个小时。"timedatectl“cmd中的O/p也显示系统时钟是同步的。但是,从ntpq程序中,rv命令的输出将系统状态字显示为:

代码语言:javascript
复制
status=c016 leap_alarm, sync_unspec, 1 event, restart,

当然,在我的理解中还存在差距&如果有人能帮忙的话。提前感谢

根据NTPSec手册的定义:

代码语言:javascript
复制
This is the minimum number of candidates available to the clock selection algorithm in order to produce one or more truechimers for the clustering algorithm. If fewer than this number are available, the clock is undisciplined and allowed to run free.
EN

回答 1

Unix & Linux用户

发布于 2023-05-08 16:47:30

这似乎是ntpsec生成配置文件(至少在debian和ubuntu上)的一个错误。minsane的默认值是1。如果设置的服务器较少,minsane 3将阻止服务器同步时间。

修复方法应该是删除tos行并使用默认值,或者将minsane 3更改为minsane 1

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

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

复制
相关文章

相似问题

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