zoukankan      html  css  js  c++  java
  • 多台linux服务器时间同步

    多台linux服务器时间同步

    ntp安装:https://www.cnblogs.com/quchunhui/p/7658853.html
    一、设置A服务器为时间服务器(加入A服务器IP为172.18.102.2)

    1 修改 /etc/ntp.conf,如下所示:

     命令:vi /etc/ntp.conf

     内容:

      # Undisciplined Local Clock. This is a fake driver intended for backup
      # and when no outside source of synchronized time is available.
      server 127.127.1.0 # local clock
      #fudge 127.127.1.0 stratum 10

    2 启动时间服务器,命令如下:

     service ntpd status

     service ntpd start

    3 查看启动结果,如下所示:

     命令:ntpq -p

     结果:

      remote refid st t when poll reach delay offset jitter
      ==============================================================================
      *LOCAL(0) .LOCL. 5 l 2 64 377 0.000 0.000 0.000

    4 设置自启动,命令如下:

     chkconfig ntpd on

    二、设置需要同步的服务器

    1 修改 /etc/ntp.conf,如下:

     命令:vi /etc/ntp.conf

     内容:

      # Undisciplined Local Clock. This is a fake driver intended for backup
      # and when no outside source of synchronized time is available.
      server 172.18.102.2 # local clock 与服务器A机时间同步
      fudge 172.18.102.2 stratum 10

    2 启动时间服务器,命令如下:

     service ntpd status

     service ntpd start

    3 查看启动结果,如下所示:

     命令:ntpq -p

     结果:

      remote refid st t when poll reach delay offset jitter
      ==============================================================================
      172.18.102.2 LOCAL(0) 6 u 5 64 1 1.377 -7077.8 0.000

    4 设置自启动,命令如下:

     chkconfig ntpd on

    5 立即同步

     ntpdate -d 172.18.102.2

     
  • 相关阅读:
    周总结6
    河北省重大需求征集系统每日进度8
    《代码整洁之道》读书笔记3
    周总结5
    河北省重大需求征集系统每日进度7
    mybatis 关联查询多个类型相同对象
    thymeleaf 接受字符串类型model值作为js方法参数报错500
    毕业设计(2.17-2.23)周工作计划
    毕业设计记录——2.16
    毕业设计记录——2.15
  • 原文地址:https://www.cnblogs.com/js1314/p/11457950.html
Copyright © 2011-2022 走看看