zoukankan      html  css  js  c++  java
  • Linux Ntp时间同步服务

    Linux NTP时间同步服务

    记录一下Linux时间同步的方法

    1、 服务器

    vi /etc/ntp.conf
    

    注释原有的restrict,添加新的restrict,ip是10.10.0.0,表示允许10.10下的所有网段,其他的机器都同步当前这一台服务器的时间

    restrict 10.10.0.0 mask 255.255.255.0 nomodify notrap
    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst
    server 127.127.1.0
    fudge 127.127.1.0 stratum 8
    
    service ntpd start
    service ntpd restart
    
    ntpq -p #观察时间同步状况
    ntpstat #查看时间同步结果
    

    2、客户端

    vi /etc/ntp.conf
    

    注释掉,注释原有的restrict,添加server

    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst
    server 10.10.23.3 #时间服务器的ip地址
    
    service ntpd start
    service ntpd restart
    
    ntpq -p #观察时间同步状况
    ntpstat #查看时间同步结果
    

    3、开机自启动自行添加

    #服务器使用的是Centos7 
    systemctl start ntpd
    
  • 相关阅读:
    第一周。。。
    新人日报1129
    Daily Report-1126
    How to read source code[repost]
    Markdown tutorial [repost]
    蘑菇街面经
    阿里面经
    百度凤巢一二面经
    Mybatis最入门---代码自动生成(generatorConfig.xml配置)
    Maven的生命周期阶段
  • 原文地址:https://www.cnblogs.com/bky-wangxin/p/13358394.html
Copyright © 2011-2022 走看看