1、现象
数据存储倾斜现象如下所示:
2、解决办法
配置如下参数到[hdfs-site.xml]中,然后重启NameNode和DataNode。
需要设置参数:
dfs.datanode.balance.bandwidthPerSec=52428800
dfs.datanode.balance.max.concurrent.moves=100
dfs.balance.bandwidthPerSec=52428800
dfs.datanode.max.xcievers=16384
注意:修改完该参数后,将配置信息下发到集群中的每个节点,然后需要重启hdfs,滚动重启即可。
3、启动数据均衡
nohup hdfs balancer -threshold 10 > balancer.log &
nohup hdfs balancer -threshold 10 > balancer.log &
4、异常处理
20/07/27 17:26:56 WARN balancer.Dispatcher: Failed to move blk_1135077177_61336722 with size=46096019 from 172.16.32.10:4001:DISK to 172.16.32.9:4001:DISK through 172.16.32.13:4001
java.io.IOException: Got error, status=ERROR, status message Not able to receive block 1135077177 from /172.16.32.15:34634 be