hadoop删除节点。

hadoop节点摘除操作:

1、确定exclude文件的位置。

<property>
    <name>dfs.hosts.exclude</name>
    <value>/data/hadoop/conf/excludes</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>

确定了exclude的文件名以及地址为:/data/hadoop/conf/excludes

2、在文件中添加需要删除的节点(可以为hostname亦可以为ip)

echo "1.1.1.1" >> /data/hadoop/conf/excludes

3、在hadoop中刷新节点的状态。

hadoop dfsadmin  -refreshNodes

4、等待该批机器的数据完成迁移。

正在执行Decommission,会显示: 
Decommission Status : Decommission in progress  
执行完毕后,会显示: 
Decommission Status : Decommissioned 

5、完成后摘除节点即可。(其中datanode程序被关闭,tasktracker需要手动关闭。)

 


原文地址:https://www.cnblogs.com/sageskr/p/3442893.html