Configured Capacity: 0 (0 B) Present Capacity: 0 (0 B) DFS Remaining: 0 (0 B) DFS Used: 0 (0 B) D

本文解决了一个HDFS集群中运行hdfsdfsadmin-report命令后显示所有容量均为0的问题。问题根源在于hosts文件配置错误,master节点的IP设置中保留了127.0.0.1 localhost或master的条目,导致HDFS无法正确识别集群节点。通过删除这些条目,HDFS能够恢复正常的数据报告。

运行hdfs dfsadmin -report没有报错,但是所有项都为0;
Configured Capacity: 0 (0 B)
Present Capacity: 0 (0 B)
DFS Remaining: 0 (0 B)
DFS Used: 0 (0 B)
DFS Used%: 0.00%
Replicated Blocks:
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0
Pending deletion blocks: 0
Erasure Coded Block Groups:
Low redundancy block groups: 0
Block groups with corrupt internal blocks: 0
Missing block groups: 0
Pending deletion blocks: 0

每一项都为0
问题在于hosts文件,应该是master节点的ip中除了集群ip之外,原来的127.0.0.1 master或localhost没有被删除,删除这两行即可。
恢复正常结果

hdfs dfsadmin -report Configured Capacity: 54716792832 (50.96 GB) Present Capacity: 32709136384 (30.46 GB) DFS Remaining: 29256388608 (27.25 GB) DFS Used: 3452747776 (3.22 GB) DFS Used%: 10.56% Replicated Blocks: Under replicated blocks: 431 Blocks with corrupt replicas: 4 Missing blocks: 10 Missing blocks (with replication factor 1): 0 Low redundancy blocks with highest priority to recover: 431 Pending deletion blocks: 0 Erasure Coded Block Groups: Low redundancy block groups: 0 Block groups with corrupt internal blocks: 0 Missing block groups: 0 Low redundancy blocks with highest priority to recover: 0 Pending deletion blocks: 0 ------------------------------------------------- Live datanodes (3): Name: 192.168.23.201:9866 (server01) Hostname: server01 Decommission Status : Normal Configured Capacity: 18238930944 (16.99 GB) DFS Used: 3452723200 (3.22 GB) Non DFS Used: 10691403776 (9.96 GB) DFS Remaining: 4094803968 (3.81 GB) DFS Used%: 18.93% DFS Remaining%: 22.45% Configured Cache Capacity: 0 (0 B) Cache Used: 0 (0 B) Cache Remaining: 0 (0 B) Cache Used%: 100.00% Cache Remaining%: 0.00% Xceivers: 1 Last contact: Fri Nov 07 14:11:57 CST 2025 Last Block Report: Fri Nov 07 14:00:09 CST 2025 Num of Blocks: 629 Name: 192.168.23.202:9866 (server02) Hostname: server02 Decommission Status : Normal Configured Capacity: 18238930944 (16.99 GB) DFS Used: 12288 (12 KB) Non DFS Used: 5659586560 (5.27 GB) DFS Remaining: 12579332096 (11.72 GB) DFS Used%: 0.00% DFS Remaining%: 68.97% Configured Cache Capacity: 0 (0 B) Cache Used: 0 (0 B) Cache Remaining: 0 (0 B) Cache Used%: 100.00% Cache Remaining%: 0.00% Xceivers: 1 Last contact: Fri Nov 07 14:11:57 CST 2025 Last Block Report: Fri Nov 07 14:00:09 CST 2025 Num of Blocks: 0 Name: 192.168.23.203:9866 (server03) Hostname: server03 Decommission Status : Normal Configured Capacity: 18238930944 (16.99 GB) DFS Used: 12288 (12 KB) Non DFS Used: 5656666112 (5.27 GB) DFS Remaining: 12582252544 (11.72 GB) DFS Used%: 0.00% DFS Remaining%: 68.99% Configured Cache Capacity: 0 (0 B) Cache Used: 0 (0 B) Cache Remaining: 0 (0 B) Cache Used%: 100.00% Cache Remaining%: 0.00% Xceivers: 1 Last contact: Fri Nov 07 14:11:57 CST 2025 Last Block Report: Fri Nov 07 14:00:09 CST 2025 Num of Blocks: 0 [root@server01 bin]# hdfs dfsadmin -safemode get Safe mode is OFF
最新发布
11-08
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值