Hadoop Balancer运行速度优化
1.修改dfs.datanode.max.transfer.threads = 4096 (如果運(yùn)行hbase的話建議為16384),指定用于在DataNode間傳輸block數(shù)據(jù)的最大線程數(shù),老版本的對(duì)應(yīng)參數(shù)為dfs.datanode.max.xcievers
2.修改dfs.datanode.balance.bandwidthPerSec = 31457280 ,指定DataNode用于balancer的帶寬為30MB,這個(gè)示情況而定,如果交換機(jī)性能好點(diǎn)的,完全可以設(shè)定為50MB,單位是Byte,如果機(jī)器的網(wǎng)卡和交換機(jī)的帶寬有限,可以適當(dāng)降低該速度,默認(rèn)是1048576(1MB)
3.修改dfs.datanode.balance.max.concurrent.moves = 50,指定DataNode上同時(shí)用于balance待移動(dòng)block的最大線程個(gè)數(shù),這個(gè)值默認(rèn)是5
4.如果配置沒(méi)生效或者不合理的話,Balancer會(huì)有如下警告信息:
16/09/14 10:10:45 WARN balancer.Dispatcher: Failed to move blk_2056340845_2915024 with size=142227625 from 192.168.1.48:50010:DISK to 192.168.1.37:50010:DISK through 192.168.1.40:50010: Got error, status message opReplaceBlock BP-457606559-192.168.1.30-1258625319448:blk_2056340845_2915024 received exception java.io.IOException: Got error, status message Not able to copy block 1252320440 to /192.168.1.37:39630 because threads quota is exceeded., copy block BP-457606559-192.168.1.30-1258625319448:blk_2056340845_2915024 from /192.168.1.40:50010, block move is failed
5.運(yùn)行balancer
su hdfs
hdfs dfsadmin -setBalancerBandwidth 104857600 #臨時(shí)設(shè)置帶寬
nohup hdfs balancer -threshold 10 & #10為各節(jié)點(diǎn)存儲(chǔ)的浮動(dòng)比例10%上下浮動(dòng)
6.Hadoop Balancer的步驟:
1、從namenode獲取datanode磁盤的使用情況
2、計(jì)算需要把哪些數(shù)據(jù)移動(dòng)到哪些節(jié)點(diǎn)
3、分別移動(dòng),完成后刪除舊的block信息
4、循環(huán)執(zhí)行,直到達(dá)到平衡標(biāo)準(zhǔn)
總結(jié)
以上是生活随笔為你收集整理的Hadoop Balancer运行速度优化的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。