您的位置:首页 > 运维架构

优化Hadoop Balancer平衡的速度

2017-12-26 15:54 477 查看
hadoop(2.7.4)集群再用过一段时间后,发现某些节点使用度特别高,而有些这存储较少,这时就考虑对hadoop进行平衡优化了

这时主要考虑两个影响因素参数的调整:

dfs.datanode.max.transfer.threads
dfs.datanode.balance.bandwidthPerSec


dfs.datanode.max.transfer.threads

修改dfs.datanode.max.transfer.threads=4096 (如果运行HBase的话建议为16384),指定用于在DataNode间传输block数据的最大线程数,老版本的对应参数为
dfs.datanode.max.xcievers


dfs.datanode.balance.bandwidthPerSec

修改dfs.datanode.balance.bandwidthPerSec=52428800,指定DataNode用于balancer的带宽为50MB,这个根据情况而定,如果交换机性能好点的,完全可以设定100MB,单位是Byte,如果机器的网卡和交换机的带宽有限,可以适当降低该速度,比如10MB,默认是1048576(1MB)。

hdfs dfsadmin-setBalancerBandwidth 52428800


优化方法

#启动数据均衡,默认阈值为 10%
$HADOOP_HOME/bin/start-balancer.sh

#启动数据均衡,阈值 5%
$HADOOP_HOME/bin/start-balancer.sh –threshold 5

#停止数据均衡
$HADOOP_HOME/bin/stop-balancer.sh


hdfs-site.xml

<property>
<name>dfs.balance.bandwidthPerSec</name>
<value>52428800</value>
<description> Specifies the maximum bandwidth that each datanode can utilize for the balancing purpose in term of the number of bytes per second. </description>
</property>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: