HDFS 定点Balance方案落地

HDFS 定点Balance方案落地,第1张

HDFS 定点Balance方案落地

HDFS 定点Balance方案落地
  • 详细方案

详细方案

加上新的datanode节点后,需要直接开始做数据的均衡,这个需要一个技巧,就是定点的balance可以加速这个过程。这就需要通过找到topN的节点先做balance。

---#!/bin/bash
source /etc/profile
export PATH=$HADOOP_HOME/bin:$PATH
Bfile=/home/hdfs/sh/balancer_hosts_raw
Bfile2=/home/hdfs/sh/balancer_hosts
startBalancer(){
        jps|grep Balancer
        if [ $? -eq 0 ];then
                echo "balancer still runing!!"
                exit 2
        fi
        # get top and bottom 30 hosts to be balancing
        hdfs dfsadmin -report -live -top 30| grep dfsUsed > $Bfile
        cat $Bfile | awk -F "'" '{print $1}' > $Bfile2
        # Set Balancer Bandwidth to 500M
        hdfs dfsadmin -setBalancerBandwidth 8194304000
        ## start balancer
        start-balancer.sh -threshold 5 -include -f /home/hdfs/sh/balancer_hosts
}
stopB(){
        stop-balancer.sh
}```

# 未来工作

到了hadoop 3之后,可以做disk粒度的balance。这种应用场景在于旧磁盘换新后,需要做数据均衡。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5678093.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存