linux多网卡ntp服务,linux – 如何通过很多同步的NTP服务器修复NTP服务器上的时间...

当你谈论回转时间时,你通常会谈论少量的时间.通过调用adjtime()来执行修复,或者在

linux上调用adjtimex().

从ntpd手册页:

-x Normally, the time is slewed if the offset is less than the step

threshold, which is 128 ms by default, and stepped if above the

threshold. This option sets the threshold to 600 s, which is

well within the accuracy window to set the clock manually.

Note: Since the slew rate of typical Unix kernels is limited to

0.5 ms/s, each second of adjustment requires an amortization

interval of 2000 s. Thus, an adjustment as much as 600 s will

take almost 14 days to complete. This option can be used with

the -g and -q options. Note: The kernel time discipline is dis‐

abled with this option.

我怀疑你是否想等待这个速度发生7小时的修正.这需要一年多的时间.在Linux上,32位系统上的adjtime有效地限制在大约2000秒的增量. 64位系统可能会成为一个非问题,但变更生效的速度仍然是一个问题.

所以在linux实现中存在一个阈值,并且可能是其他人,在这个阈值下你会得到一个非常缓慢的“转换”,但是超过这个阈值,主服务器和客户端上的系统时钟将会步进,这可以更快地进行.

还有另一个阈值,如果主服务器和客户端之间的时间差太大,客户端将承担错误而不更新.从ntpd手册页:

-g Normally, ntpd exits with a message to the system log if the

offset exceeds the panic threshold, which is 1000 s by default.

This option allows the time to be set to any value without

restriction; however, this can happen only once. If the thresh‐

old is exceeded after that, ntpd will exit with a message to the

system log. This option can be used with the -q and -x options.

请注意,几乎肯定没有为守护进程设置-g选项.它通常用作ntpd -gq,在系统启动时作为一次性运行,或者手动运行,与ntpdate非常相似.恐慌阈值可能在编译时可配置,因此请查看操作系统供应商的手册页.

编写一个程序是非常简单的,它将使用您选择的任何频率和大小的调整进行一系列时间调整.您可以在ntp master上执行此操作,它将为其客户端提供调整的时间,但您需要知道客户端系统将接受的最大大小调整,以及将导致它们执行非常慢的转换的最小阈值.为安全起见,您应该调查客户端系统上的ntp实现.

如果您在没有-x选项的情况下更新具有类似于默认ntpd的特性的系统,那么您可以使用类似于每5秒进行半秒调整的方案,并且您将在大约3天的过程中进行同步.进行不超过第二个边界的亚秒级调整可能有助于避免触发cron作业两次,但预计您可能会发现某种副作用.

如果您在服务器不再彼此同步的情况下结束,那么它会变得更加混乱.如果可行的话,我想监视时差,并且如果某些服务器不再跟随,则自动停止执行自动定期更新,并发出警报.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值