zoukankan      html  css  js  c++  java
  • 三台服务器的时间同步-Linux

    192.168.1.30    做服务器时间

    192.168.1.40   同步30

    192.168.1.50  同步30

    step1.在30机器上修改ntp.conf

    添加:

    restrict  192.168.1.0 mask  255.255.255.0  nomodify notrap

    说明:根据自己的该啊

    注销:

    #server 0.rhel.pool.ntp.org iburst
    #server 1.rhel.pool.ntp.org iburst
    #server 2.rhel.pool.ntp.org iburst
    #server 3.rhel.pool.ntp.org iburst

    添加:

    server  127.127.1.0  #  local clock
    fudge   127.127.1.0  stratum  10

    保证BIOS(主板)与系统时间同步

    vim  /etc/sysconfig/ntpd    

    添加:SYNC_HWLOCK=yes

    启动ntpd的运行进程

    service  ntpd start

    service  ntpd status   --保证服务启动

    在40机器上:

    [root@saver1 ~]# ntpdate -u  192.168.1.30

    28 Jul 13:03:37 ntpdate[2698]: step time server 192.168.1.30 offset 14401.695083 sec

    在50机器上:

    [root@saver2 ~]# ntpdate -u  192.168.1.30

    28 Jul 13:03:51 ntpdate[2663]: step time server 192.168.1.30 offset 14401.690938 sec

    date 查看时间已经同步

    配置定时器,定时每分钟与时钟服务器进行同步

    crontab  -e

    */1 * * * * /usr/sbin/ntpdate 192.168.1.30

    《完》

  • 相关阅读:
    Flash代码执行原理与性能优化笔记
    服务器自建git
    列表删除
    mysql的隔离级别实践
    py2和py3的字符编码
    Django外键(ForeignKey)操作以及related_name的作用
    python多个装饰器嵌套
    git diff使用
    .gitignore 只包含几个文件
    三层菜单字典练习
  • 原文地址:https://www.cnblogs.com/hello-wei/p/11258625.html
Copyright © 2011-2022 走看看