zoukankan      html  css  js  c++  java
  • HDFS DataNode 退役 旧节点

    一、白名单

    1、在NameNode节点,创建dfs.hosts,并添加白名单主机名

    cd /opt/module/hadoop-2.7.7/etc/hadoop/
    vim dfs.hosts
    # 内容
    wt1
    wt2
    wt3

    2、在NameNode的hdfs-site.xml配置文件中增加dfs.hosts属性

    vim etc/hadoop/hdfs-site.xml
    <property>
        <name>dfs.hosts</name>
        <value>/opt/module/hadoop-2.7.7/etc/hadoop/dfs.hosts</value>
    </property>

    3、分发hdfs-site.xml文件

    xsync etc/hadoop/hdfs-site.xml

    4、刷新NameNode

    hdfs dfsadmin -refreshNodes

    5、更新ResourceManager节点

    yarn rmadmin -refreshNodes

    6、检测

    http://wt1:50070/dfshealth.html#tab-datanode

    4个节点变3个节点

    7、实现集群的再平衡

    sbin/start-balancer.sh

    二、黑名单

    1、NameNode节点创建dfs.hosts.exclude文件

    cd /opt/module/hadoop-2.7.7/etc/hadoop/
    vim dfs.hosts.exclude
    # 黑名单
    wt5

    2、在NameNode的hdfs-site.xml配置文件中增加dfs.hosts.exclude属性

    vim hdfs-site.xml
    
    
    <property>
        <name>dfs.hosts.exclude</name>
        <value>/opt/module/hadoop-2.7.7/etc/hadoop/dfs.hosts.exclude</value>
    </property>

    3、分发hdfs-site.xml文件

    xsync hdfs-site.xml

    4、刷新NameNode

    hdfs dfsadmin -refreshNodes

    别忘 Nodes ,习惯性忘记添加 s

    5、刷新ResourceManager

    yarn rmadmin -refreshNodes

    6、查看效果

    http://wt1:50070/dfshealth.html#tab-datanode

    7、关闭wt5的DataNode和NodeManager

    sbin/hadoop-daemon.sh stop datanode
    sbin/yarn-daemon.sh stop nodemanager

    8、实现集群的再平衡

    sbin/start-balancer.sh

    三、总结

    黑名单相当于断联,不向该节点存放任意数据

    http://wt1:50070/dfshealth.html#tab-datanode

  • 相关阅读:
    matlab基础知识
    reverse number
    C++基础知识(一)
    ES6 let const学习
    [ZZ]一名IT从业者的英语口语能力成长路径
    使用windows Live Writer 以及office word 2013发布文章到博客园总结
    CString.format的用法
    Cstring 与 string 注意点
    卡尔曼滤波应用
    linux 重新挂载分区(教程)
  • 原文地址:https://www.cnblogs.com/wt7018/p/13599395.html
Copyright © 2011-2022 走看看