1)节点间数据均衡
开启数据均衡命令:
start-balancer.sh –threshold 10
对于参数10,代表的是集群中各个节点的磁盘空间利用率相差不超过10%,可根据实际情况进行调整。
停止数据均衡命令:
stop-balancer.sh
2)磁盘间数据均衡
(1)生成均衡计划
hdfs diskbalancer -plan hadoop102
(2)执行均衡计划
hdfs diskbalancer -execute hadoop102.plan.json
(3)查看当前均衡任务的执行情况
hdfs diskbalancer -query hadoop102
(4)取消均衡任务
hdfs diskbalancer -cancel hadoop102.plan.json