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

    root 用户操作

    1,rpm -qa|grep ntp 查看机器是否安装ntp

    2,vi /etc/ntp.conf

      修改:

    #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
    restrict 192.168.178.0 mask 255.255.255.0 nomodify notrap      

    192.168.178.0  代表网段

     注释:

    #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# local clock

    fudge 127.127.1.0 stratum 10

    保存,退出

    3,vi /etc/sysconfig/ntpd

    新增:

    SYNC_HWCLOCK=yes

    4,查看ntpd 服务

    service status ntpd , 有可能会提醒用systemctl 命令

    systemctl status ntpd

    开启

    systemctl start ntpd, systemctl enable ntpd(重启生效,保存到状态文件)

    systemctl stop ntpd,systemctl disable ntpd(重启生效,保存到状态文件)

    至此,时间校准的服务器配好

    5,其他客户端,需要校准服务器

    设置定时任务:crontab -e

    0-59/10 * * * * /usr/sbin/ntpdate hella-hadoop.chris.com

    hella-hadoop.chris.com 是服务器

    每隔10 分钟会校准一次

    也可以/usr/sbin/ntpdate hella-hadoop.chris.com直接校准

  • 相关阅读:
    HDU 3401 Trade
    POJ 1151 Atlantis
    HDU 3415 Max Sum of MaxKsubsequence
    HDU 4234 Moving Points
    HDU 4258 Covered Walkway
    HDU 4391 Paint The Wall
    HDU 1199 Color the Ball
    HDU 4374 One hundred layer
    HDU 3507 Print Article
    GCC特性之__init修饰解析 kasalyn的专栏 博客频道 CSDN.NET
  • 原文地址:https://www.cnblogs.com/pickKnow/p/10822483.html
Copyright © 2011-2022 走看看