设为首页 收藏本站
查看: 839|回复: 0

[经验分享] hadoop hdfs balance

[复制链接]

尚未签到

发表于 2016-12-5 07:26:36 | 显示全部楼层 |阅读模式
转载:http://hi.baidu.com/hovlj_1130/blog/item/20200da530603af99052eed9.html

hadoop hdfs balance

最近集群的某些dump节点容量报警,hadoop dfsadmin -report可以发现,报警的节点,均为日志上传至hdfs的节点,在hadoop fs -put时,大部分hdfs文件都直接保存在了put的节点.
因此需要使用hadoop Balancer Administrator Guide.

下面是E文描述:

The balancer is a tool that  balances disk space usage on an HDFS cluster when some
datanodes become full or when new empty nodes join the cluster. The tool is deployed as
an application program that can be run by the cluster administrator on a live HDFS
cluster while application adding and deleting files.

SYNOPSIS

To start:
bin/start-balancer.sh [-threshold <threshold>]
Example: bin/ start-balancer.sh
start the balancer with a default threshold of 10%
bin/ start-balancer.sh -threshold 5
start the balancer with a threshold of 5%

To stop:
bin/ stop-balancer.sh

DESCRIPTION

The threshold parameter is a fraction in the range of (0%, 100%) with a default value of
10%. The threshold sets a target for whether the cluster is balanced. A cluster is balanced
if for each datanode, the utilization of the node (ratio of used space at the node to total
capacity of the node) differs from the utilization of the cluster (ratio of used space in the
cluster to total capacity of the cluster) by no more than the threshold value. The smaller
the threshold, the more balanced a cluster will become. It takes more time to run the
balancer for small threshold values. Also for a very small threshold the cluster may not be
able to reach the balanced state when applications write and delete files concurrently.

The  tool moves  blocks from  highly utilized datanodes  to  poorly utilized datanodes
iteratively. In each iteration a datanode moves or receives no more than the lesser of 10G
bytes or the threshold fraction of its capacity. Each iteration runs no more than 20
minutes. At the end of each iteration, the balancer obtains updated datanodes information
from the namenode.

A system property that limits the balancer’s use of bandwidth is defined in the default
configuration file:

<property>
<name>dfs.balance.bandwidthPerSec</name>
<value>1048576</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>

This property determines the maximum speed at which a block will be moved from one
datanode to another. The default value is 1MB/s. The higher the bandwidth, the faster a
cluster  can reach the  balanced  state,  but  with  greater competition   with application
processes. If an administrator changes the value of this property in the configuration file,
the change is observed when HDFS is next restarted.

在使用start-balancer.sh时,如果在hdfs-site.xml里面没有配置dfs.balance.bandwidthPerSec,那么集群hdfs内部默认使用1M/S的速度移动数据(so slowly...),我们可以通过在hdfs-site.xml里面配置dfs.balance.bandwidthPerSec来加快balance的速度。

最开始我们配置的是20m/S
<property>
<name>dfs.balance.bandwidthPerSec</name>
<value>20971520</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>

然后结果是导致job运行变得不稳定,出现一些意外的长map单元,某些reduce时间处理变长(整个集群负载满满的情况下,外加20m/s的balance),在前天的中国hadoop年会上听淘宝调整的为10m/s,需要调整后实验,看看情况如何。

另外再修改dfs.balance.bandwidthPerSec参数后,需要在namenode上运行stop-dfs.sh start-dfs.sh重启hdfs生效。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-309647-1-1.html 上篇帖子: [Hadoop] Hive HQL 下篇帖子: Hadoop的SemiJoin
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表