hadoop要发到每个节点的配置文件,只有core-site.xml mapred-site.xml hdfs-site.xml 添加节点
2.修改namenode的配置文件conf/slaves 3.在新节点的机器上,启动服务 [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
1) 如果不balance,那么cluster会把新的数据都存放在新的node上,这样会降低mapred的工作效率 [root@slave-004 hadoop]# ./bin/start-balancer.sh -threshold 5 3) 设置balance的带宽,默认只有1M/s <property> <name>dfs.balance.bandwidthPerSec</name> <value>1048576</value> <description> Specifies the maximum amount of bandwidth that each datanode can utilize for the balancing purpose in term of the number of bytes per second. </description> </property>
注意:
删除节点
1.集群配置 <property> <name>dfs.hosts.exclude</name> <value>/data/soft/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>
2.确定要下架的机器 slave-003 slave-004 3.强制重新加载配置 [root@master hadoop]# ./bin/hadoop dfsadmin -refreshNodes 它会在后台进行Block块的移动
4.关闭节点 [root@master hadoop]# ./bin/ hadoop dfsadmin -report 可以查看到现在集群上连接的节点 正在执行Decommission,会显示: Decommission Status : Decommission in progress 执行完毕后,会显示: Decommission Status : Decommissioned
5.再次编辑excludes文件 |