Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out actual disk usage in HDFS

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

like image 632
Aliaxander Avatar asked Aug 07 '15 07:08

Aliaxander


People also ask

How do I check my HDFS file size in GB?

You can use the “hadoop fs -ls command”. This command displays the list of files in the current directory and all it's details.In the output of this command, the 5th column displays the size of file in bytes. For e.g. The size of file shivangi is 36789 bytes.

How do I clear HDFS disk usage?

Simply follow this path; from the Ambari Dashboard, click HDFS -> Configs -> Advanced -> Advanced core-site. Then set the 'fs. trash. interval' to 0 to disable.

Is there a HDFS command to see available free space in HDFS?

You can see the free available space through the browser localhost:50070/dfshealth.

How do I find the size of a directory in hadoop?

To get the size of the directory hdfs dfs -du -s -h /$yourDirectoryName can be used.


1 Answers

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
like image 174
Balduz Avatar answered Oct 03 '22 19:10

Balduz