hadoop如何添加节点

1.部署hadoop
  和普通的datanode一样。安装jdk,ssh
2.修改host
  和普通的datanode一样。添加namenode的ip
3.修改namenode的配置文件conf/slaves
  添加新增节点的ip或host
4.在新节点的机器上,启动服务
Java代码 复制代码  收藏代码
  1. [root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start datanode   
  2. [root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start tasktracker  
	[root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start datanode
	[root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start tasktracker


5.均衡block
Java代码 复制代码  收藏代码
  1. [root@slave-004 hadoop]# ./bin/start-balancer.sh  
[root@slave-004 hadoop]# ./bin/start-balancer.sh

这个会非常耗时
1)如果不balance,那么cluster会把新的数据都存放在新的node上,这样会降低mapred的工作效率
2)设置平衡阈值,默认是10%,值越低各节点越平衡,但消耗时间也更长
[root@slave-004 hadoop]# ./bin/start-balancer.sh -threshold 5
3)设置balance的带宽,默认只有1M/s
Xml代码 复制代码  收藏代码
  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>  
<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. 必须确保slave的firewall已关闭;
2. 确保新的slave的ip已经添加到master及其他slaves的/etc/hosts中,反之也要将master及其他slave的ip添加到新的slave的/etc/hosts中
1.部署hadoop
  和普通的datanode一样。安装jdk,ssh
2.修改host
  和普通的datanode一样。添加namenode的ip
3.修改namenode的配置文件conf/slaves
  添加新增节点的ip或host
4.在新节点的机器上,启动服务
Java代码 复制代码  收藏代码
  1. [root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start datanode   
  2. [root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start tasktracker  
	[root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start datanode
	[root@slave-004 hadoop]# ./bin/hadoop-daemon.sh start tasktracker


5.均衡block
Java代码 复制代码  收藏代码
  1. [root@slave-004 hadoop]# ./bin/start-balancer.sh  
[root@slave-004 hadoop]# ./bin/start-balancer.sh

这个会非常耗时
1)如果不balance,那么cluster会把新的数据都存放在新的node上,这样会降低mapred的工作效率
2)设置平衡阈值,默认是10%,值越低各节点越平衡,但消耗时间也更长
[root@slave-004 hadoop]# ./bin/start-balancer.sh -threshold 5
3)设置balance的带宽,默认只有1M/s
Xml代码 复制代码  收藏代码
  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>  
<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. 必须确保slave的firewall已关闭;
2. 确保新的slave的ip已经添加到master及其他slaves的/etc/hosts中,反之也要将master及其他slave的ip添加到新的slave的/etc/hosts中

猜你喜欢

转载自p-x1984.iteye.com/blog/1116897