Find out actual disk usage in HDFS
Asked Answered
H

3

8

Is there a way to find out how much space is consumed in HDFS? I used

hdfs dfs -df

but it seems to be not relevant cause after deleting huge amount of data with

hdfs dfs -rm -r -skipTrash

the previous comand displays changes not at once but after several minutes (I need up-to-date disk usage info).

Hygroscope answered 7/8, 2015 at 7:39 Comment(1)
No solution?? Plase comment the answer that show a valid solution.Worrywart
O
4

hadoop cli is deprecated. Use hdfs instead.

Folder wise :

sudo -u hdfs hdfs dfs -du -h /

Cluster wise :

sudo -u hdfs hdfs dfsadmin -report
Odontograph answered 28/11, 2018 at 11:1 Comment(0)
X
7

To see the space consumed by a particular folder try:

hadoop fs -du -s /folder/path

And if you want to see the usage, space consumed, space available, etc. of the whole HDFS:

hadoop dfsadmin -report
Ximenez answered 7/8, 2015 at 8:11 Comment(2)
Unfortunately hadoop dfsadmin -report shows not up-to-date info too.Hygroscope
... And the correct command today (2019) is hdfs dfsadmin -reportWorrywart
O
4

hadoop cli is deprecated. Use hdfs instead.

Folder wise :

sudo -u hdfs hdfs dfs -du -h /

Cluster wise :

sudo -u hdfs hdfs dfsadmin -report
Odontograph answered 28/11, 2018 at 11:1 Comment(0)
U
-1
hadoop fs -count -q /path/to/directory
Unintelligible answered 24/1, 2017 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.