• 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直接校准

  • 相关阅读:
    处理跨浏览器的事件处理程序
    html5 canvas时钟
    拖拽事件的原理
    改变top使用轮播图
    程序开发之最大子数组
    第四周学习进度
    敏捷开发相关阅读
    构建之法读书笔记04
    四则运算终结版
    第三周学习进度
  • 原文地址:https://www.cnblogs.com/pickKnow/p/10822483.html
Copyright © 2020-2023  润新知