hadoop集群balance工具详解

在线上的Hadoop集群运维过程中,hadoop 的balance工具通常用于平衡hadoop集群中各datanode中的文件块分布,以避免出现部分datanode磁盘占用率高的问题(这问题也很有可能导致该节点CPU使用率较其他服务器高)。

     1) hadoop balance工具的用法:

[html]  view plain  copy
  1. To start:  
  2. bin/start-balancer.sh [-threshold <threshold>]  
  3. Example: bin/ start-balancer.sh  
  4. start the balancer with a default threshold of 10%  
  5. bin/ start-balancer.sh -threshold 5  
  6. start the balancer with a threshold of 5%  
  7.   
  8. To stop:  
  9. bin/ stop-balancer.sh   
      2)影响hadoop balance工具的几个参数:

             -threshold 默认设置:10,参数取值范围:0-100,参数含义:判断集群是否平衡的目标参数,每一个 datanode 存储使用率和集群总存储使用率的差值都应该小于这个阀值 ,理论上,该参数设置的越小,整个集群就越平衡,但是在线上环境中,hadoop集群在进行balance时,还在并发的进行数据的写入和删除,所以有可能无法到达设定的平衡参数值。

            dfs.balance.bandwidthPerSec  默认设置:1048576(1 M/S),参数含义:设置balance工具在运行中所能占用的带宽,设置的过大可能会造成mapred运行缓慢

     3)hadoop balance工具其他特点:

           balance工具在运行过程中,迭代的将文件块从高使用率的datanode移动到低使用率的datanode上,每一个迭代过程中移动的数据量不超过下面两个值的较小者:10G或者指定阀值*容量,且每次迭代不超过20分钟。每次迭代结束后,balance工具将更新该datanode的文件块分布情况。以下为官方文档英文描述:

[python]  view plain  copy
  1. The  tool moves  blocks from  highly utilized datanodes  to  poorly utilized datanodes  
  2. iteratively. In each iteration a datanode moves or receives no more than the lesser of 10G  
  3. bytes or the threshold fraction of its capacity. Each iteration runs no more than 20  
  4. minutes. At the end of each iteration, the balancer obtains updated datanodes information  
  5. from the namenode.  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值