我对 Hadoop hdfs 有一些问题。(Hadoop 2.7.3)我有 2 个名称节点(1 个活动,1 个备用)和 3 个数据节点。复制因子为 3。
$ hdfs dfs -df -h /
Filesystem Size Used Available Use%
hdfs://hadoop-cluster 131.0 T 51.3 T 79.5 T 39%
使用的磁盘是 51T 的-df
命令。
$ hdfs dfs -du -h /
912.8 G /dir1
2.9 T /dir2
但是用-du
命令的磁盘大约是3T。
我发现其中一个数据节点达到了 100% 的使用率。
Live datanodes (3):
datanode1:
Configured Capacity: 48003784114176 (43.66 TB)
DFS Used: 2614091989729 (2.38 TB)
Non DFS Used: 95457946911 (88.90 GB)
DFS Remaining: 45294174318384 (41.19 TB)
DFS Used%: 5.45%
DFS Remaining%: 94.36%
*****datanode2******
Configured Capacity: 48003784114176 (43.66 TB)
DFS Used: 48003784114176 (43.66 TB)
Non DFS Used: 0
DFS Remaining: 0
DFS Used%: 100%
DFS Remaining%: 0%
datanode3:
Configured Capacity: 48003784114176 (43.66 TB)
DFS Used: 2615226250042 (2.38 TB)
Non DFS Used: 87496531142 (81.49 GB)
DFS Remaining: 45301001735984 (41.20 TB)
DFS Used%: 5.45%
DFS Remaining%: 94.37%
我的问题是
- 我试着做
balancer
。它似乎可以工作,但所有迭代都没有移动任何块,并且它存在没有任何错误。如何平衡数据节点的磁盘使用量?为什么hdfs balancer
命令不移动任何块?
19/11/06 11:27:51 INFO balancer.Balancer: Decided to move 10 GB bytes from datanode2:DISK to datanode3:DISK
19/11/06 11:27:51 INFO balancer.Balancer: chooseStorageGroups for SAME_RACK: overUtilized => belowAvgUtilized
19/11/06 11:27:51 INFO balancer.Balancer: chooseStorageGroups for SAME_RACK: underUtilized => aboveAvgUtilized
19/11/06 11:27:51 INFO balancer.Balancer: chooseStorageGroups for ANY_OTHER: overUtilized => underUtilized
19/11/06 11:27:51 INFO balancer.Balancer: chooseStorageGroups for ANY_OTHER: overUtilized => belowAvgUtilized
19/11/06 11:27:51 INFO balancer.Balancer: chooseStorageGroups for ANY_OTHER: underUtilized => aboveAvgUtilized
19/11/06 11:27:51 INFO balancer.Balancer: Will move 10 GB in this iteration
19/11/06 11:27:51 INFO balancer.Dispatcher: Limiting threads per target to the specified max.
19/11/06 11:27:51 INFO balancer.Dispatcher: Allocating 5 threads per target.
No block has been moved for 5 iterations. Exiting...
虽然
datanode2
已满,但节点的状态显示为“In-service”或“Live”或“Normal”。当然,在这种情况下,我无法在 hdfs 中写入新数据。结果
-df
和结果-du
相差太大。为什么?