ntp时间同步返回“no server suitable for synchromization found”的排查

简介:

背景:

  linux系统时间不同步,手动执行
ntpdate time2.aliyun.com

报错

no server suitable for synchromization found

登陆系统,先看看时间
1,查看系统时间
date
hwclock --show 查看硬件时间

2,查看ntp.conf
1

3,手动同步,看看现场(多试几个~)
2

4,使用调试模式看下

ntpdate -d 10.143.33.50

返回如下:

7 Mar 09:46:51 ntpdate[24930]: ntpdate 4.2.2p1@1.1570-o Sat Dec 20 02:52:11 UTC 2014 (1)
Looking for host 10.143.33.50 and service ntp
host found : 10.143.33.50
transmit(10.143.33.50)
transmit(10.143.33.50)
transmit(10.143.33.50)
transmit(10.143.33.50)
transmit(10.143.33.50)
10.143.33.50: Server dropped: no data
server 10.143.33.50, port 123
stratum 0, precision 0, leap 00, trust 000
refid [10.143.33.50], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036 14:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036 14:28:16.000
transmit timestamp:  dc688f8e.b4e8c8ab  Tue, Mar  7 2017  9:46:54.706
filter delay:  0.00000  0.00000  0.00000  0.00000 
         0.00000  0.00000  0.00000  0.00000 
filter offset: 0.000000 0.000000 0.000000 0.000000
         0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

 7 Mar 09:46:55 ntpdate[24930]: no server suitable for synchronization found

5,根据debug到的报错,有2个原因可能导致该问题
5.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去掉。

5.2,检查ecs的防火墙。可能是防火墙屏蔽了udp 123端口。(ecs的话还要注意安全组)
可以用命令停止防火墙测试

service iptables stop

本例原因是iptables规则设置有问题导致

进阶版-->ipv6引起的对时超时

目录
相关文章
|
运维 Linux
Linux NTP服务详解
Linux NTP服务详解
1346 1
|
Java
Mac下安装JDK11(国内镜像)
Mac下安装JDK11(国内镜像)
9700 0
|
监控 Ubuntu 算法
chrony介绍和安装
Chrony是一款高精度网络时间同步工具,支持NTP协议,提供纳秒级时钟校准,适用于服务器及对时间精度要求高的系统。具备自动漂移补偿、断网恢复、灵活配置等特性,广泛用于Linux环境的时间管理。
3359 0
|
10月前
|
域名解析 开发框架 .NET
从零开始:注册域名、租用主机并部署PageAdmin CMS完整教程
本文详细介绍了注册域名、租用虚拟主机、上传PageAdmin CMS并完成网站部署的全流程。从域名查询购买、主机环境配置到程序安装,提供完整的操作指南,帮助新手顺利完成网站上线。
895 5
|
人工智能 Kubernetes Devops
VMware vSphere 9.0 下载 - 企业级工作负载平台
VMware vSphere 9.0 下载 - 企业级工作负载平台
1203 9
VMware vSphere 9.0 下载 - 企业级工作负载平台
|
SQL 分布式计算 Ubuntu
基于Hadoop的数据仓库Hive安装
基于Hadoop的数据仓库Hive安装
1380 0
|
网络安全
构建 NTP 时间服务器
构建 NTP 时间服务器
1275 2
信不信?工作这么多年,还有很多网工不知道光模块光衰的正常范围?
信不信?工作这么多年,还有很多网工不知道光模块光衰的正常范围?
3490 2
|
Linux 网络安全 开发工具
linux 时间同步 chrony
linux 时间同步 chrony
1986 1