1. 程式人生 > >hadoop balance工具平衡集群dfs存儲及遇到異常Got error, status message Not able to receive block 1073959989 from /192.168.1.37:3004 because threads quota is exceeded

hadoop balance工具平衡集群dfs存儲及遇到異常Got error, status message Not able to receive block 1073959989 from /192.168.1.37:3004 because threads quota is exceeded

receive 增加 tool 運行時 rop 平衡 star 命令 dem

hadoop集群某個節點dfs存儲比其他節點存儲高時,一般會使用hadoop提供的balance(start-balancer.sh -threshold 10 )工具來移動高存儲節點上的塊到低存儲節點上.

其中 -threshold 默認設置:10,參數取值範圍:0-100,參數含義:判斷集群是否平衡的目標參數,每一個 datanode 存儲使用率和集群總存儲使用率的差值都應該小於這個閥值 ,理論上,該參數設置的越小,整個集群就越平衡,但是在線上環境中,hadoop集群在進行balance時,還在並發的進行數據的寫入和刪除,所以有可能無法達到設定的平衡參數值

進行平衡時,可能會拋出 "because threads quota is exceeded., block move is failed" 這樣的異常,這是因為在rebalanecing server啟動的線程數有限,hdfs-site.xml配置中(dfs.datanode.balance.max.concurrent.moves)默認配置是5,可以適當將該值調大

在hdfs-site.xml中(註意!!!相應的datanode節點也要設置,不然運行時會拋異常,配置後重新啟動對應的namenode與datanode)

<property>
        <name>dfs.datanode.balance.max.concurrent.moves</name>
        <value>1024</value>
</property>

一般主機性能好的可以調整到300~1024不等

在運行時拷貝的數據也會受帶寬影響,hdfs-site.xml中(dfs.datanode.balance.bandwidthPerSec)默認配置值是1M即是1048576字節,視集群帶寬情況而定(ifconfig 命令查看網卡,ethtool 命令 指定網卡 如:ethtool eth1 查看帶寬其中的Speed項就是帶寬)設置好帶寬

<property>
        <name>dfs.datanode.balance.bandwidthPerSec</name>
        <value>10485760</value>
</property>

另外,一般在平衡時,可以先停止存儲比較高的節點上的nodemanager,這樣在該節點上就不會受本地nodemanager落數據到本地,使得本地存儲迅速增加的影響.

hadoop balance工具平衡集群dfs存儲及遇到異常Got error, status message Not able to receive block 1073959989 from /192.168.1.37:3004 because threads quota is exceeded