zoukankan      html  css  js  c++  java
  • 集群时间同步

    配置时间同步实操:  

    1)时间服务器配置(必须root用户)

    (1)检查ntp是否安装

    [root@hadoop61 ~]# rpm -qa|grep ntp

    ntp-4.2.6p5-10.el6.centos.x86_64

    fontpackages-filesystem-1.41-1.1.el6.noarch

    ntpdate-4.2.6p5-10.el6.centos.x86_64

    (2)修改ntp配置文件

      [root@hadoop61 ~]# vi /etc/ntp.conf

      修改内容如下

      a)修改

    #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap为

    restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

             b)修改

    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 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

             c)添加

    server 127.127.1.0

    fudge 127.127.1.0 stratum 10

    (3)修改/etc/sysconfig/ntpd 文件

        [root@hadoop61 ~]# vim /etc/sysconfig/ntpd

        增加内容如下

          SYNC_HWCLOCK=yes

    (4)重新启动ntpd

    [root@hadoop61 ~]# service ntpd status

          ntpd 已停

        [root@hadoop61 ~]# service ntpd start

          正在启动 ntpd:                                            [确定]

           (5)执行:

                  [root@hadoop61 ~]# chkconfig ntpd on

     2)其他机器配置(必须root用户) 

    (1)在其他机器配置10分钟与时间服务器同步一次

                  [root@hadoop62 ~]# crontab -e

                  编写脚本

                  */10 * * * * /usr/sbin/ntpdate hadoop61

    (2)修改任意机器时间

                  [root@hadoop62 ~]# date -s "2017-9-11 11:11:11"

    (3)十分钟后查看机器是否与时间服务器同步

                  [root@hadoop62 ~]# date

  • 相关阅读:
    CPA财务管理例题汇总
    Vulkan(1)用apispec生成Vulkan库
    Vulkan(0)搭建环境-清空窗口
    [译]可见性判断之门系统
    《资本论》核心思想
    [译]为任意网格计算tangent空间的基向量
    [译]Vulkan教程(33)多重采样
    [译]Vulkan教程(32)生成mipmap
    [译]Vulkan教程(31)加载模型
    [译]Vulkan教程(30)深度缓存
  • 原文地址:https://www.cnblogs.com/singlecodeworld/p/9599748.html
Copyright © 2011-2022 走看看