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 ~]# 
复制代码

 

posted @   woshinidaye  阅读(107)  评论(0编辑  收藏  举报
编辑推荐:
· 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数据库查询与断言
点击右上角即可分享
微信分享提示