一、datanode添加新节点

1 在dfs.include文件中包含新节点名称,该文件在名称节点的本地目录下

[白名单]

[s201:/soft/hadoop/etc/hadoop/dfs.include]

2  在hdfs-site.xml文件中添加属性

 <property>

     <name>dfs.hosts</name>

     <value>/soft/hadoop/etc/dfs.include.txt</value>

   </property>

3 在nn上刷新节点

Hdfs dfsadmin -refreshNodes

4 在slaves文件中添加新节点ip(主机名)

5 单独启动新节点中的datanode

Hadoop-daemon.sh start datanode

二、datanode退役旧节点

1 添加退役节点的ip到黑名单 dfs.hosts.exclude,不要更新白名单

[/soft/hadoop/etc/dfs.hosts.exclude]

2 配置hdfs-site.xml

   <property>

     <name>dfs.hosts.exclude</name>

     <value>/soft/hadoop/etc/dfs.hosts.exclude.txt</value>

   </property>

3 刷新nn的节点

hdfs dfsadmin -refreshNodes

4 查看WEBUI,节点状态在Decommission  In Progress

5 当所有的要退役的节点都报告为Decommissioned,数据转移工作已经完成

6 从白名单删除节点,并刷新节点

hdfs dfsadmin -refreshNodes

yarn rmadmin -refreshNodes

7 从slaves文件中删除退役的节点

8 hdfs-site.xml文件内容

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--> <!-- Put site-specific property overrides in this file. --> <configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/soft/hadoop/name/</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/soft/hadoop/data</value>
</property>
<property>
<name>dfs.namenode.fs-limits.min-block-size</name>
<value>1024</value>
</property>
<property>
<name>dfs.hosts.exclude</name>
<value>/soft/hadoop/etc/dfs.hosts.exclude.txt</value>
</property>
</configuration>

三、黑白名单组合结构

Include   //dfs.hosts

Exclude   //dfs.hosts.exclude

白名单   黑名单 组合结构
No No Node may not connect 
No Yes Node may not connect
Yes No Node may connect
Yes Yes Node may connect and will be decommissioned

四、图文

黑名单文件

刷新节点信息

退役中

五、yarn添加新节点

1  在dfs.include文件中包含新节点名称,该文件在名称节点的本地目录下

[白名单]

[s201:/soft/hadoop/etc/hadoop/dfs.include]

2  在yarn-site.xml文件中添加属性

    <property>

     <name>yarn.resourcemanager.nodes.include-path</name>

     <value>/soft/hadoop/etc/dfs.include.txt</value>

   </property>

3 在rm上刷新节点

yarn rmadmin-refreshNodes

4 在slaves文件中添加新节点ip(主机名)

5 单独启动新节点中的资源管理器

yarn-daemon.sh start nodemanager

六、yarn退役新节点

1 添加退役节点的ip到黑名单 dfs.hosts.exclude,不要更新白名单

[/soft/hadoop/etc/dfs.hosts.exclude]

2 配置yarn-site.xml

<property>

<name>yarn-resourcemanager.nodes.exclude-path</name>

<value>/soft/hadoop/etc/dfs.hosts.exclude.txt</value>

</property>

3 刷新rm的节点

yarn rmadmin -refreshNodes

4 查看WEBUI,节点状态在Decommission  In Progress

5 当所有的要退役的节点都报告为Decommissioned,数据转移工作已经完成

6 从白名单删除节点,并刷新节点

yarn rmadmin -refreshNodes

7 从slaves文件中删除退役的节点

注意:因为退役的时候副本数没有改变。所以要在退役的时候增加新的节点,只是做退役的话,因为不满足最小副本数要求,一直会停留在退役中,如果想更快的退役的话要使得退役后的副本数仍然达到最小副本数要求。

最新文章

  1. ios app的版本号
  2. WPF去边框与webbrowser的冲突
  3. Android中webview和js之间的交互(转)
  4. github 建立博客
  5. 面向侧面的程序设计AOP-------《一》概述
  6. Qt自定义model
  7. Snappy压缩
  8. Freemarker日期函数处理【转】
  9. Redis持久化磁盘IO方式及其带来的问题   有Redis线上运维经验的人会发现Redis在物理内存使用比较多,但还没有超过实际物理内存总容量时就会发生不稳定甚至崩溃的问题,有人认为是基于快照方式持
  10. [CentOS] rsync同步目录进行备份文件
  11. JAVA 线程池之Callable返回结果
  12. Lab 9-1
  13. 一台服务器绑定多个ip地址
  14. Daily Scrumming* 2015.12.20(Day 12)
  15. [Offer收割]编程练习赛15 A.偶像的条件[贪心]
  16. 【Golang 接口自动化01】使用标准库net/http发送Get请求
  17. 使用VI编辑器在Linux下编写Java文件
  18. BZOJ 4421: [Cerc2015] Digit Division 排列组合
  19. xss实现获取内网ip
  20. HDU 5228 ZCC loves straight flush 暴力

热门文章

  1. 嵌入式开发之makefile---交叉编译静态库和动态库的生成和调用
  2. CI框架 -- URL
  3. (https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014550004)Topic: Caught java.io.CharConversionException. ERRORCODE=-4220, SQLSTATE=null
  4. 系统中hosts文件有哪些作用
  5. iOS多版本多设备适配的问题
  6. Uploading File using Ajax and receiving binary data in Asp.net (C#)[转]
  7. 基于bootstrap-multiselect.js的下拉框联动
  8. 中企ITIL需软落地
  9. webApi2 结合uploadify 上传报错解决办法
  10. Ubuntu14.04下Mongodb(离线安装方式|非apt-get)安装部署步骤(图文详解)(博主推荐)