添加节点
[root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start datanode [root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start tasktracker
4.均衡block [root@slave-004 hadoop]# ./bin/start-balancer.sh
[root@slave-004 hadoop]# ./bin/start-balancer.sh -threshold 5 3)设置balance的带宽,默认只有1M/s 1 <property> 2 <name>dfs.balance.bandwidthPerSec</name> 3 <value>1048576</value> 4 <description> 5 Specifies the maximum amount of bandwidth that each datanode 6 can utilize for the balancing purpose in term of 7 the number of bytes per second. 8 </description> 9 </property>
注意:
删除节点
1.集群配置 1 <property> 2 <name>dfs.hosts.exclude</name> 3 <value>/data/soft/hadoop/conf/excludes</value> 4 <description>Names a file that contains a list of hosts that are 5 not permitted to connect to the namenode. The full pathname of the 6 file must be specified. If the value is empty, no hosts are 7 excluded.</description> 8 </property>
slave-003 slave-004
[root@master hadoop]# ./bin/hadoop dfsadmin -refreshNodes 它会在后台进行Block块的移动
[root@master hadoop]# ./bin/ hadoop dfsadmin -report
可以查看到现在集群上连接的节点 正在执行Decommission,会显示: Decommission Status : Decommission in progress 执行完毕后,会显示: Decommission Status : Decommissioned
|