NTP-ntpdate 问题处理

解决ntp的错误 no server suitable for synchronization found

当用ntpdate -d 来查询时会发现导致 no server suitable for synchronization found 的错误的信息有以下2个:

错误1.Server dropped: Strata too high

在ntp客户端运行ntpdate serverIP,出现no server suitable for synchronization found的错误。

在ntp客户端用ntpdate –d serverIP查看,发现有“Server dropped: strata too high”的错误,并且显示“stratum 16”。而正常情况下stratum这个值得范围是“0~15”。

这是因为NTP server还没有和其自身或者它的server同步上。

以下的定义是让NTP Server和其自身保持同步,如果在/ntp.conf中定义的server都不可用时,将使用local时间作为ntp服务提供给ntp客户端。

server 127.127.1.0

fudge 127.127.1.0 stratum 8

在ntp server上重新启动ntp服务后,ntp server自身或者与其server的同步的需要一个时间段,这个过程可能是5分钟,在这个时间之内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。

那么如何知道何时ntp server完成了和自身同步的过程呢?

在ntp server上使用命令:

# watch ntpq -p

出现画面:

注意LOCAL的这个就是与自身同步的ntp server。

注意reach这个值,在启动ntp server服务后,这个值就从0开始不断增加,当增加到17的时候,从0到17是5次的变更,每一次是poll的值的秒数,是64秒*5=320秒的时间。

如果之后从ntp客户端同步ntp server还失败的话,用ntpdate –d来查询详细错误信息,再做判断。

错误2.Server dropped: no data

从客户端执行netdate –d时有错误信息如下:

transmit(192.168.30.22)

transmit(192.168.30.22)

transmit(192.168.30.22)

transmit(192.168.30.22)

transmit(192.168.30.22)

192.168.30.22: Server dropped: no data

server 192.168.30.22, port 123

.....

28 Jul 17:42:24 ntpdate[14148]: no server suitable for synchronization found

出现这个问题的原因可能有2:

1。检查ntp的版本,如果你使用的是ntp4.2(包括4.2)之后的版本,在restrict的定义中使用了notrust的话,会导致以上错误。

使用以下命令检查ntp的版本: # ntpq -c version

下面是来自ntp官方网站的说明:

The behavior of notrust changed between versions 4.1 and 4.2.

In 4.1 (and earlier) notrust meant "Don't trust this host/subnet for time".

In 4.2 (and later) notrust means "Ignore all NTP packets that are not cryptographically authenticated." This forces remote time servers to authenticate themselves to your (client) ntpd

解决:

把notrust去掉。

2。检查ntp server的防火墙。

可能是server的防火墙屏蔽了upd 123端口。

可以用命令: #service iptables stop

来关掉iptables服务后再尝试从ntp客户端的同步,如果成功,证明是防火墙的问题,需要更改iptables的设置。

最新文章

  1. idea key
  2. 隐写技巧——利用JPEG文件格式隐藏payload
  3. 如何读懂 STATSPACK 报告 (转) & Toad 结合
  4. ViewPager设置 缓存个数、页卡间距、数据更新
  5. 激活Windows 10
  6. 信号之system函数
  7. UVA 11754 Code Feat 中国剩余定理+暴力
  8. Maven实战一
  9. C语言中所有变量和常量所使用的内存总结
  10. Delphi - 闲来无事,自己写个Timer玩玩(多线程Timer)
  11. Python_PyMySQL数据库操作
  12. python selenium模拟滑动操作
  13. 数组的常用方法concat,join,slice和splice的区别,map,foreach,reduce
  14. 第85节:Java中的JavaScript
  15. C# ImageHelper
  16. Hexo博客搭建以及Next主题美化的经验之谈
  17. Lync 2013安装中遇到的关于SQL Mirroring的一次报错的解决
  18. jquery ajax 为什么会 多次请求
  19. vue-cl发布vue
  20. websocket协议及案例

热门文章

  1. JS 点击复制Copy插件--Zero Clipboard
  2. animation与transition
  3. javascript创建自定义对象和prototype
  4. Silverlight调用网站项目的Session
  5. C#实现防拷贝工具示例
  6. Android Studio添加应用作为依赖时报错Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: 及其解决方案
  7. Comparator TreeSet
  8. jQuery中的$.extend方法总结
  9. 10--动作系统(四)动作类中的reverse方法
  10. flash播放器遮挡页面中元素问题解决