【Linux】ntp的一些坑。你肯定遇到过
ntpdate提示
19 Jan 10:33:11 ntpdate[29616]: no server suitable for synchronization found
这种问题从下面几个点开始验证
1.查看防火墙是否开通udp的123端口,是udp 无法使用telnet来验证,只能看iptables和硬墙是否有策略
2.如果端口开通,查看服务器端的ntp.conf文件中server是否正常,如果配置有问题,肯定无法使用
3.修改配置是否重新启动ntpd服务
4.查看服务端ntpd进程是否正常
ntpdate -d ntp服务端ip
遇到的几个问题
1.Server dropped:no data
处理办法:网络不通,检查防火墙的udp端口123是否能用,查看服务端的ntpd服务是否启动
[root@ip-192.168.25.10 ~]# ntpdate -d 192.168.25.10
19 Jan 10:24:16 ntpdate[27838]: ntpdate 4.2.6p5@1.2349-o Tue Jun 23 15:38:19 UTC 2020 (1)
Looking for host 192.168.25.10 and service ntp
host found : ip-192.168.25.10.ap-southeast-1.compute.internal
transmit(192.168.25.10)
transmit(192.168.25.10)
transmit(192.168.25.10)
transmit(192.168.25.10)
transmit(192.168.25.10)
192.168.25.10: Server dropped: no data
server 192.168.25.10, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.25.10], delay 0.00000, dispersion 64.00000
ansmitted 4, in filter 4
▽ference time: 00000000.00000000 Mon, Jan 1 1900 8:05:43.000
originate timestamp: 00000000.00000000 Mon, Jan 1 1900 8:05:43.000
transmit timestamp: e3b0c156.2402fb9d Tue, Jan 19 2021 10:24:22.140
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 19 Jan 10:24:24 ntpdate[27838]: no server suitable for synchronization found
2.Server dropped: strata too high
这个问题一般都是server端ntp.conf中server行配置了网络ntp的服务端url导致,可以收到ntp的包,但是延迟很高。
1 [root@ip-192.168.25.10 ~]# ntpdate -d 192.168.25.10
2 19 Jan 10:33:32 ntpdate[29681]: ntpdate 4.2.6p5@1.2349-o Tue Jun 23 15:38:19 UTC 2020 (1)
3 Looking for host 192.168.25.10 and service ntp
4 host found : ip-192.168.25.10.ap-southeast-1.compute.internal
5 transmit(192.168.25.10)
6 receive(192.168.25.10)
7 transmit(192.168.25.10)
8 receive(192.168.25.10)
9 transmit(192.168.25.10)
10 receive(192.168.25.10)
11 transmit(192.168.25.10)
12 receive(192.168.25.10)
13 192.168.25.10: Server dropped: strata too high
14 server 192.168.25.10, port 123
15 stratum 16, precision -24, leap 11, trust 000
16 refid [192.168.25.10], delay 0.02573, dispersion 0.00000
17 transmitted 4, in filter 4
18 reference time: 00000000.00000000 Mon, Jan 1 1900 8:05:43.000
19 originate timestamp: e3b0c382.6344a1b6 Tue, Jan 19 2021 10:33:38.387
20 transmit timestamp: e3b0c382.670289fb Tue, Jan 19 2021 10:33:38.402
21 filter delay: 0.02574 0.02573 0.02574 0.02573
22 0.00000 0.00000 0.00000 0.00000
23 filter offset: -0.01470 -0.01471 -0.01471 -0.01471
24 0.000000 0.000000 0.000000 0.000000
25 delay 0.02573, dispersion 0.00000
26 offset -0.014712
27
28 19 Jan 10:33:38 ntpdate[29681]: no server suitable for synchronization found
解决办法就是将服务端也开启ntpdate 然后通过ntpdate链接网络url的ntp服务器,然后在ntp.conf中配置server 127.127.1.0 (记住 不是127.0.0.1 这个无效)
在打开ntpq -p 查看是否转为LOCAL了
[root@ip-192.168.25.10 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 8 l 11 64 17 0.000 0.000 0.000
正确的ntpdate -d 应该是下面的
1 [root@ip-192.168.25.10 ~]# ntpdate -d 192.168.25.10
2 19 Jan 10:35:25 ntpdate[30125]: ntpdate 4.2.6p5@1.2349-o Tue Jun 23 15:38:19 UTC 2020 (1)
3 Looking for host 192.168.25.10 and service ntp
4 host found : ip-192.168.25.10.ap-southeast-1.compute.internal
5 transmit(192.168.25.10)
6 receive(192.168.25.10)
7 transmit(192.168.25.10)
8 receive(192.168.25.10)
9 transmit(192.168.25.10)
10 receive(192.168.25.10)
11 transmit(192.168.25.10)
12 receive(192.168.25.10)
13 server 192.168.25.10, port 123
14 stratum 6, precision -24, leap 00, trust 000
15 refid [192.168.25.10], delay 0.02574, dispersion 0.00000
16 transmitted 4, in filter 4
17 reference time: e3b0c3eb.878bf296 Tue, Jan 19 2021 10:35:23.529
18 originate timestamp: e3b0c3f3.442fd9c7 Tue, Jan 19 2021 10:35:31.266
19 transmit timestamp: e3b0c3f3.47e920c0 Tue, Jan 19 2021 10:35:31.280
20 filter delay: 0.02574 0.02574 0.02574 0.02576
21 0.00000 0.00000 0.00000 0.00000
22 filter offset: -0.01465 -0.01465 -0.01465 -0.01466
23 0.000000 0.000000 0.000000 0.000000
24 delay 0.02574, dispersion 0.00000
25 offset -0.014652
26
27 19 Jan 10:35:31 ntpdate[30125]: adjust time server 192.168.25.10 offset -0.014652 sec
ps:以上ip均已做脱敏处理
【Linux】ntp的一些坑。你肯定遇到过的更多相关文章
- linux ntp时间同步
linux ntp时间同步 一.搭建时间同步服务器1.编译安装ntp serverrpm -qa | grep ntp若没有找到,则说明没有安装ntp包,从光盘上找到ntp包,使用rpm -Uvh n ...
- 笔记本装双系统!win10+Linux!所有的坑自己一个个爬过来,纪念一下。
笔记本装双系统!win10+Linux!所有的坑自己一个个爬过来,纪念一下. 2018年09月16日 21:27:19 Corax_2ven 阅读数:14038 写在前面,装了大概5遍,装了删删了 ...
- linux ntp时间服务器配置
Network Time Protocol (NTP) 也是RHCE新增的考试要求. 学习的时候也顺便复习了一下如何设置Linux的时间,现在拿出来和大家分享 设置NTP服务器不难但是NTP本身是一个 ...
- [笔记]Linux NTP命令 (ESX适用)
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://delxu.blog.51cto.com/975660/307513 [推荐阅读] ...
- 跳入linux的第一个坑-因为安装Ubuntu导致的硬盘被误格的恢复.(记TestDisk使用记录)
不看废话,直接跳到操作说明 前几日心血来潮想把家中的旧笔记本换成Linux操作系统,算是在业余生活中正式投入Linux的怀抱.说干就干,发行版选择了Ubuntu,下载了Ubuntu16.04的ISO, ...
- .NET Core 图片操作在 Linux/Docker 下的坑
一.前言 .NET Core 目前更新到2.2了,但是直到现在在 .NET Core 本身依然不包括和图片有关的 Image.Bitmap 等类型.对于图片的操作在我们开发中很常见,比如:生成验证码. ...
- SUSE Linux 下redis 的坑
前面redis服务器安装-SuSE Linux Enterprise Server 11 SP3一章中安装好提示开放防火墙后的一些坑 前面漏了说明redis作为一个高速数据库,在互联网上,对应的安全机 ...
- Linux探索之路1---CentOS入坑笔记整理
前言 上次跟运维去行方安装行内环境,发现linux命令还是不是很熟练.特别是用户权限分配以及vi下的快捷操作.于是决定在本地安装一个CentOS虚拟机,后面有时间就每天学习一点Linux常用命令. 作 ...
- .NetCore&Linux&Docker&Portainer踩坑历险记
最近有一个云服务器和数据库的迁移任务,踩坑爬坑无数次,觉得必须要记录一下.大家瓜子花生准备好,听我慢慢讲故事#手动笑哭#. 故事背景 公司是做电商业务的,在天猫有几家旗舰店数据量也很大.阿里有一个称为 ...
随机推荐
- 一文搞懂I/O多路复用机及其技术
前言 高性能是每个程序员的追求,无论写一行代码还是做一个系统,都希望能够达到高性能的效果.高性能架构设计主要集中在两方面: 尽量提升单服务器的性能,将单服务器的性能发挥到极致 如果单服务器无法支撑 ...
- abp.zero 9.0框架的前端Angular使用说明
abp.zero 9.0框架的前端Angular使用说明 目录 abp.zero 9.0框架的前端Angular使用说明 摘要 1 部署及启动 1.1 依赖包安装 1.2 使用yarn安装依赖包 1. ...
- js上 十九、综合案例
十九.综合案例 题目一: 封装一个函数equal(a1,a2),传入两个一维数组,判断两个数组是否包含相同的元素,如果相等,函数的返回值为true, 不相等,函数的返回值为false 1)例:arr1 ...
- vue第一单元(初识webpack-webpack的功能-webpack的初步使用)
第一单元(初识webpack-webpack的功能-webpack的初步使用) #课程目标 了解webpack出现的意义,以及webpack解决的前端问题 掌握webpack的使用流程和步骤 掌握we ...
- 题解 P1579 【哥德巴赫猜想(升级版)】
蒟蒻AC代码,讲解请看题解中. 1 #include<bits/stdc++.h> 2 #include<iostream> 3 #include<cmath> / ...
- 使用BulkLoad恢复hbase数据
问题: hbase 集群启动不了,maste一直在初始化,数据面临丢失风险. 解决: 把hbfs上 /hbase 目录移走 改名为/hbase-bak 删除zk上的数据,重新建立一个新的hbase集群 ...
- CVE-2019-0708——RDP漏洞利用
影响系统:windows2003.windows2008.windows2008 R2.windows xp .win7环境:攻击机:kali ip:192.168.40.128靶机:windows ...
- Networking from the container's point of view 笔记
Networking from the container's point of view Published portsThe type of network a container uses, w ...
- 老哥你能写篇 SpringCloud Alibaba 全家桶吗? 看视频太累 太枯燥了 !
最喜欢的一句话: 1.01的365次方=37.78343433289 >>>1 0.99的365次方= 0.02551796445229, 每天进步一点点的目标,贵在坚持 前端时间有 ...
- python归并排序
由于某人问我要个归并排序,就凑合写了一个,AA = raw_input().split(' ') A = []; for num in AA: A.append(int(num)) def Merge ...