美文网首页大数据程序员
大数据||hadoop集群的时间同步

大数据||hadoop集群的时间同步

作者: 明明德撩码 | 来源:发表于2018-02-23 16:42 被阅读146次

    各大银行、证券、通讯集群内部时间同步,找一台机器作为时间基准,其他机器同步一次时间。

    时间服务器配置

    检测是否安装ntp工具

    rpm -qa|grep ntp


    修改vi /etc/ntp.conf

    • 开启#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap并把192.168.1.0修改为192.168.57.0
      去掉注解(本地网络上的主机限制较少。)
    • 注释掉网络同步时间

    Please consider joining the pool
    server 0.centos.pool.ntp.org
    server 1.centos.pool.ntp.org
    server 2.centos.pool.ntp.org

    • 去掉注释 无纪律的本地时间。
      当没有外部时间源时,对本地时间进行备份。

    • 总体修改图


      image.png

    开启主同步时钟

    • 命令:vi /etc/sysconfig/ntpd

    在此文件中新增: SYNC_HWCLOCK=yes


    • 修改 vi /etc/sysconfig/ntpdate


    • 查看ntpd服务是否启动(时间同步服务)

      service ntpd status


    • 启动

    service ntpd start


    • 随系统一起启动
    chkconfig ntpd on

    被同步的服务节点(132/133节点服务器)编写时间同步脚本(计划任务)

    linux|计划任务

    -crontab -e
    0-59/10 * * * * /usr/sbin/ntpdate hadoop-senior.beifeng.com
    说明:每10分钟在131服务器上同步一次时间。


    133服务器
    132服务器

    相关文章

      网友评论

        本文标题:大数据||hadoop集群的时间同步

        本文链接:https://www.haomeiwen.com/subject/jfrxxftx.html