zoukankan      html  css  js  c++  java
  • ntp时间服务器安装

    参考
     
    安装
    tar zxvf ntp-4.2.6p5.tar.gz
    cd ntp-4.2.6p5
    ./configure && make -j32 && make install
     
    服务器配置(de79)
    修改配置文件:vi /etc/ntp.conf
    #权限设置
    #restrict default nomodify notrap noquery                    #默认拒绝所有来源的任何访问
    #restrict -6 default kod nomodify notrap nopeer noquery 
    restrict 127.0.0.1      mask 255.0.0.0                      #开放本机的任何访问
    restrict 192.168.0.0    mask 255.255.255.0 nomodify         #开放本网段的可查询访问
     
    #上级时间服务器设置
    server cn.pool.ntp.org prefer  #优先使用cn.pool.ntp.org和上级时间服务器同步.  cn.pool.ntp.org中国国家授时中心服务器地址.
     
    #客户端认证
    #keys /etc/ntp/keys
     
    运行ntp
    service ntpd start/stop/restart
    chkconfig ntpd on
     
    客户端配置
    修改配置文件:vi /etc/ntp.conf
    step1:/etc/ntpd.conf 写入 server [IP_Address] , 这里是192.168.2.79
    step2:chkconfig ntpd on
    step3:service ntpd start
     
     
    注:
    查看ntp的端口,应该看到123端口
    netstat -unlnp
     
    查看ntp服务器有无和上层连通
    [root@S5 ~]# ntpstat
    synchronised to NTP server () at stratum 2
    time correct to within 74 ms
    polling server every 128 s
    注意:此命令出现上述synchronised结果比较慢,我的用了大概5分钟。
     
    查看ntp服务器与上层间的联系
    [root@S5 ~]# ntptrace -n 127.0.0.1
    127.0.0.1: stratum 2, offset 0.064524, synch distance 0.121167
    210.72.145.44: timed out, nothing received***Request timed out
     
    查看ntp服务器与上层ntp服务器的状态
    [root@S5 ~]# ntpq -p
    其中,
    remote - 本机和上层ntp的ip或主机名,“+”表示优先,“*”表示次优先
    refid - 参考上一层ntp主机地址
    st - stratum阶层
    when - 多少秒前曾经同步过时间
    poll - 下次更新在多少秒后
    reach - 已经向上层ntp服务器要求更新的次数
    delay - 网络延迟
    offset - 时间补偿
    jitter - 系统时间与bios时间差
     




  • 相关阅读:
    SQL第3课:具有约束的查询(第2部分)
    SQL第1课:SELECT查询
    idea快捷键
    Vue基础
    分布式基础
    数据结构-线性表
    常用算法
    数据结构-概述
    Django使用Jinja2模板引擎
    宿主机nginx使用容器php-fpm处理php请求
  • 原文地址:https://www.cnblogs.com/hustlijian/p/3087768.html
Copyright © 2011-2022 走看看