linux ntpd 时间渐变,linux之NTP时间同步服务介绍

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 forces the time to be slewed in all cases. If the step threshold is set to zero, all offsets are stepped, regardless of value and regardless of the

-x option. In general, this is not a good idea, as it bypasses the clock state machine which is designed to cope with large time and frequency errors Note: Since the slew rate is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment of many seconds can take hours or days to amortize. This option can be used with the

-q option.

结果发现-x只是提高了时间跳变的阈值,在client与server时间差小于600秒时,时间的调整使用渐变,大于600秒,时间调整使用跳变形式。

查了很多资料,最后确定在ntp配置文件/etc/ntp.conf中添加字段:

tinker panic 600

这句话的意思是在时间差大于600秒的情况下,ntpd进程自动关闭,ntpd退出时会向/var/log/messages中写入log

在时间差过大时,应该由用户手动设置系统时间或者调用ntpdate命令,这样能避免因为时间跳变出现的问题。

四、ntpq的用法和参数解释

ntpq是ntp的辅助命令,用来查看ntp的运行状态

0818b9ca8b590ca3270a3433284dd417.png

参数 功能 示例

remote 时间服务器地址

refid 上一级ntp服务器 可以是ip;或其他比如:JJY (LF Fukushima, Japan) time standard radio receiver;GPS

St Stratum值 0~16

t Type,服务器通讯类型 U:unicast

When 上一次与服务器通讯时间

Poll 轮询间隔 默认64

Reach 通讯成功次数 8位二进制数,成功一次左移一位

Delay 本地与服务器通信时延

Offset 本地与服务器的时间偏差

Jitter

在remote项前边,会现实client与server的同步状态,正常同步用“*”表示,备用服务器用"+"表示,未同步不现实,就像上图那样.

详细说明:

状态 含义

“ ” 1)non-communicating remote machines

2) “LOCAL” for this local host

3)(unutilised) high stratum servers

“x” Out of tolerance, do not use (discarded by intersection algorithm);

“-” Out of tolerance, do not use (discarded by the cluster algorithm);

“#” Good remote peer or server but not utilised (not among the first six peers sorted by synchronization distance, ready as a backup source);

“+” Good and a preferred remote peer or server (included by the combine algorithm);

“*” The remote peer or server presently used as the primary reference;

“o” PPS peer

五、参考文献

限于自身知识有限,且表达能力欠佳,下边列出我觉得很有参考价值的网页文章,大家可以详细学习

http://www.cnblogs.com/zhouhbing/p/3877104.html http://blog.itpub.net/14184018/viewspace-694078/ http://lists.ntp.org/pipermail/questions/2007-May/014166.html http://blog.itpub.net/28371090/viewspace-769264/ http://bbs.chinaunix.net/thread-4156663-1-1.html http://doc.ntp.org/4.1.0/miscopt.htm http://lists.ntp.org/pipermail/questions/2005-February/004468.html http://nlug.ml1.co.uk/2012/01/ntpq-p-output/831 http://support.hp.com/us-en/document/c03651251 http://www.clock.org/ntp/prefer.html https://www.eecis.udel.edu/~mills/ntp/html/select.html http://www.ntp.org/ntpfaq/NTP-s-def.htm http://www.ietf.org/rfc/rfc5905.txt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值