Find out actual disk usage in HDFS

Aliaxander picture Aliaxander · Aug 7, 2015 · Viewed 18.7k times · Source

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).

Answer

Balduz picture Balduz · Aug 7, 2015

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