使用hadoop dfsadmin -report命令查看磁盘使用情况
如果是下面的情况
Configured Capacity: 0 (0 B)
Present Capacity: 0 (0 B)
DFS Remaining: 0 (0 B)
DFS Used: 0 (0 B)
DFS Used%: NaN%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
------------------------------------------------- Datanodes available: 0 (0 total, 0 dead)
这个问题的原因是使用hadoop namenode -format格式化时格式化了多次造成那么spaceID不一致
解决方案:
1、停止dfs
$./stop-dfs.sh
2、删除在hdfs中配置的data目录和tmp目录
$ rm -r /home/data
$ rm -r /home/tmp
重新创建data目录和tmp目录
$ mkdir data
$ mkdir tmp
3、重新格式化namenode
$ hadoop namenode -format
4、重新启动dfs
$./start-dfs.sh
5、查看dfs
$ jps
使用hadoop dfsadmin -report查看使用情况
Hostname: master
Decommission Status : Normal
Configured Capacity: 16775028736 (15.62 GB)
DFS Used: 24576 (24 KB)
Non DFS Used: 8850161664 (8.24 GB)
DFS Remaining: 7924842496 (7.38 GB)
DFS Used%: 0.00%
DFS Remaining%: 47.24%
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: Wed Jan 24 23:29:54 PST 2018
类似这样,则成功