《Hadoop管理三》集群移除旧节点

Hadoop集群管理员可能需要从集群中移除节点。过程其实很简单:

  1. 将待移除的节点的ip地址添加到exclude文件中,exclude文件有由hdfs-site.xml中的dfs.hosts.exclude指定的文件内容指定。
  2. 重启MapReduce集群,这是为了终止在待移除节点上运行的tasktracker。
  3. 执行命令 bin/hadoop dfsadmin -refreshNodes。 这个过程Hadoop会将待移除节点上的数据移动到其他的节点上。此时待移除节点处在Decommission in Progress。
  4. 当所有的节点变为 Decommissioned状态的时候,即可关闭待移除的节点机器
  5. 从conf/slaves、dfs.hosts.exclude和mapred.hosts.exclude指定的文件中移除待移除节点的ip
  6. 执行命令 bin/hadoop dfsadmin -refreshNodes。

 

<property>
<name>dfs.hosts.exclude</name>
<value></value>
<description>Names a file that contains a list of hosts that are
not permitted to connect to the namenode. The full pathname of the
file must be specified. If the value is empty, no hosts are
excluded.</description>
</property>

 

<property>
  <name>mapred.hosts.exclude</name>
  <value></value>
  <description>Names a file that contains the list of hosts that
  should be excluded by the jobtracker.  If the value is empty, no
  hosts are excluded.</description>
</property>
posted @ 2012-07-25 19:56  hanyuanbo  阅读(311)  评论(0编辑  收藏  举报