-1

I have an Hadoop cluster and within it I have a path that, when filled, causes a lot of problems. I want to write a script that checks the usage/capacity of the path for review on a semiweekly basis. My command and results:

$ hdfs dfs -df -h /my/fat/directory 
Filesystem                   Size     Used  Available  Use%
hdfs://TheServer         866.9 T  593.7 T    242.4 T   68%

Regardless of path provided I get the usage for the entire cluster rather than the considerably smaller directory I'm worried about.

How can I get the disk usage for my directory?

EDIT:

To clarify I want the capacity of the directory and the usage. Not just the usage. -du is not acceptable.

Nanor
  • 2,400
  • 6
  • 35
  • 66
  • Possible duplicate of [How to find the size of a HDFS file](http://stackoverflow.com/questions/11574410/how-to-find-the-size-of-a-hdfs-file) – Ani Menon Jan 07 '17 at 17:40

2 Answers2

1

Try with below

hdfs dfs -du -s -h /path/to/dir or hadoop fs -du -s -h /path/to/dir

Check with below for capacity

hdfs dfs -du -h /path/to/dir

BruceWayne
  • 3,286
  • 4
  • 25
  • 35
0

The command I was looking for was the quota set on the directory.

hdfs dfs -count -q -h -v /path/to/dir/

Nanor
  • 2,400
  • 6
  • 35
  • 66