1.节点删除
html
1)修改conf/hdfs-site.xml文件,excludes文件的目录。以下:node
<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)刷新配置,执行以下命令:ssh
bin/hadoop dfsadmin -refreshNodes
4)查看状态jsp
在命令行使用命令 : 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依然存在,须要手工处理一下
oop
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
spa