NTP时钟同步
centos首先安装NTP服务
yum isntall -y ntp
安装完成后,配置ntp配置文件
vi /etc/ntp.conf
使用阿里云NTP服务器作为时钟源
server ntp1.aliyun.com
启动NTP服务器
service ntpd start
同步时间
ntpdate master
查看同步结果
ntpq -p
[root@kvm ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*120.25.115.20 10.137.53.7 2 u 46 64 177 46.107 25.673 16.683
remote: 远端时钟源地址;
refid: 参考上一次时钟地址;
st:stratum阶层;
when:多少秒以前同步过
poll:下次更新在多少秒后
reach:已经向上层ntp服务器要求更新的次数
delay:网络延迟
offset:时间补偿 重点关注!
jitter:系统时间与bios时间差
[root@tcp-dump-2 ~]# timedatectl Local time: Tue 2020-10-13 23:17:55 CST Universal time: Tue 2020-10-13 15:17:55 UTC RTC time: Tue 2020-10-13 15:17:55 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: n/a [root@tcp-dump-2 ~]# timedatectl set-ntp yes [root@tcp-dump-2 ~]# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== 120.25.115.20 10.137.53.7 2 u 15 64 1 92.365 9.387 0.000 [root@tcp-dump-2 ~]# [root@tcp-dump-2 ~]# [root@tcp-dump-2 ~]# date Tue Oct 13 15:18:56 CST 2020 [root@tcp-dump-2 ~]# timedatectl status Local time: Tue 2020-10-13 15:19:09 CST Universal time: Tue 2020-10-13 07:19:09 UTC RTC time: Tue 2020-10-13 15:19:09 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: n/a [root@tcp-dump-2 ~]#
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· Qt个人项目总结 —— MySQL数据库查询与断言