zoukankan      html  css  js  c++  java
  • Centos-时间服务器

    一,CentOS服务器
     
    测试ntp服务:
    [root@localhost ~]# ntpdate time.nist.gov 22 Oct 21:11:43 ntpdate[5014]: adjust time server 207.200.81.113 offset -0.018788 sec
     
    1,不存在ntp服务
    yum install ntp
     
    测试ntp服务成功, 编辑/etc/crontab添加:
    */10 * * * * ntpdate time.nist.gov   #域名或IP  (每隔十分钟同步一次)
    推荐几个时间服务器。
    time.nist.gov
    time.nuri.net
    asia.pool.ntp.org
    asia.pool.ntp.org
    asia.pool.ntp.org
    asia.pool.ntp.org
     
    2, 存在ntp服务
    <1>,创建时间服务器
    [1], 编辑/etc/ntp.conf
    restrict 192.168.20.0 mask 255.255.255.0 nomodify notrap
     
    nomodify - 用户端不能更改ntp服务器的时间参数
    noquery - 用户端不能使用ntpq,ntpc等命令来查询ntp服务器
    notrap - 不提供trap远端登陆
     
    [2], 开启ntp服务
    chkconfig ntpd on  // 让ntp服务开机启动 
    /etc/init.d/ntpd start // 启动ntp服务
     
    [3], 查看ntp服务端口
    netstat -unlnp  (如果正常,应该可以看到123端口已经开启)
    <2>, 设置子服务器
    [1], 编辑/etc/ntp.conf添加时间服务器地址
    server 192.168.20.91
     
    [2],   启动ntp服务
    chkconfig ntpd on  // 让ntp服务开机启动 
    /etc/init.d/ntpd start // 启动ntp服务
     
    NTP服务进程 :
    netstat -upnl |grep ntpd //查看时程
    ntpq -pn //查看同步的服务器IP
    ntpstat //同步的结果
  • 相关阅读:
    如何获取地址栏中的参数
    Ajax基础知识
    什么是BFC
    111
    不定宽 块状元素居中3
    POJ 2104主席树
    可持久化数据结构之主席树
    线段树
    Splay 学习
    hello world
  • 原文地址:https://www.cnblogs.com/wanhua-wu/p/6514006.html
Copyright © 2011-2022 走看看