鼓捣了好几天hadoop2.2集群(关于节点删除+ssh免密码登陆)

1.节点删除

1)修改conf/hdfs-site.xml文件,excludes文件的目录。如下:

<property>
    <name>dfs.hosts.exclude</name>  
   <value>/home/hadoop/hadoop-2.2.0/etc/hadoop/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>

2)在excludes文件中指定要下架的机器,如:

    slave1

3)刷新配置,执行如下命令:

bin/hadoop dfsadmin  -refreshNodes

4)查看状态

在命令行使用命令 : bin/hadoop dfsadmin -report
或者在浏览器查看:http://XXXXX:50070/dfshealth.jsp
出现如下状态,同时Blocks的数量也在减少。
Live Nodes     :    10 (Decommissioned: 0)    
Dead Nodes     :    0 (Decommissioned: 0)    
Decommissioning Nodes     :    2    
Number of Under-Replicated Blocks    :    106106

5)再次编辑excludes文件 
    一旦完成了机器下架,它们就可以从excludes文件移除了 
   登录要下架的机器,会发现DataNode进程没有了,但是TaskTracker依然存在,需要手工处理一下

6). 遇到的问题:
        (1)刚开始刷新配置,block数目不动。可能原因:安全模式
            bin/hadoop dfsadmin -safemode leave
       (2) block 数量不断减少,但后来数量就不动了。 可能原因:集群的免密码登陆可能有问题,检查一下。

3.附加:免密码登陆

http://www.cnblogs.com/jdksummer/articles/2521550.html
同时注意权限问题。
ssh配置成功后,启动hadoop节点出现Are you sure you want to continue connecting (yes/no)?

输入yes


你可能感兴趣的:(关于节点删除,ssh免密码登陆)