• NTP 时间同步


    rpm -q ntp -- 验证是否安装 ntp 服务
    yum install -y ntp -- 群发,如果没有 ntp 服务则安装一个
    systemctl enable ntpd
    systemctl start ntpd
    systemctl status ntpd

    配置服务端

    vim /etc/ntp.conf
     
    1. restrict 127.0.0.1
    2. restrict ::1
    3. server 0.centos.pool.ntp.org iburst
    4. server 1.centos.pool.ntp.org iburst
    5. server 2.centos.pool.ntp.org iburst
    6. server 3.centos.pool.ntp.org iburst

    [root@153 ~]# ntpstat
    synchronised to NTP server (202.118.1.81) at stratum 2
       time correct to within 983 ms
       polling server every 64 s
    [root@153 ~]# ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
    *time.neu.edu.cn .PTP.            1 u   16   64    1   61.155   14.381   7.256
     sv1.ggsrv.de    192.53.103.103   2 u   15   64    1  241.410   18.393   0.197
     111.230.189.174 100.122.36.196   2 u   14   64    1   21.831   16.980   0.174
     time.neu.edu.cn .PTP.            1 u   13   64    1   59.822   15.195   0.231

    客户端配置:

    1. vim /etc/ntp.conf
    2. restrict 127.0.0.1
    3. restrict ::1
    4. server *.*.*.*  #指向serverIP

    测试是否正常

    [root@154 ~]# ntpstat
    unsynchronised
      time server re-starting
       polling server every 8 s
    [root@154 ~]# ntpstat
    synchronised to NTP server (191.191.170.153) at stratum 12 
       time correct to within 1462 ms
       polling server every 64 s
    [root@dwzt154 ~]# ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
    t153         111.230.189.174  3 u   18   64  377    0.297   67.915  15.657
    [root@dwzt154 ~]# ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
    153         LOCAL(0)        11 u   22   64  377    0.245   31.356   4.721

  • 相关阅读:
    SpringBoot-38-Dubbo概述
    一年一度的科技狂欢盛会——2022亚马逊云科技re:Invent全球大会
    使用Tomcat搭建一个Servlet项目
    「高效程序员的修炼」快速上手Shell编程、执行与定时任务
    最小生成树学习笔记
    【missing-semester】The shell
    Android实时获取摄像头画面传输至PC端
    Unity 获取任意按键输入
    【VPX637】基于XCKU115 FPGA+ZU15EG MPSOC的6U VPX双FMC接口通用信号处理平台
    性能测试工具:Jmeter介绍
  • 原文地址:https://blog.csdn.net/guoshaoliang789/article/details/126977419