How to get block report from one specific rack in Hadoop?

523 Views Asked by At

I am wondering whether it is possible to get block report only from one rack in hadoop?

I know I can get a whole block report with the following command:

hdfs fsck / -files -blocks -racks

However, when your cluster is big, it takes a lot of time to run the command. I want only to see the blocks located in a specific rack. Is there any way to get the report only from one rack? (i.e., specify rack instead of the path)

Thanks in advance

1

There are 1 best solutions below

0
tk421 On

No, unfortunately you can't. You can file a JIRA upstream to have this added to hdfs fsck. However, remember, HDFS file replication always tries to keep one copy on a different rack for better fault-tolerance so even if you could target one rack, you'd still be referring to files distributed across the entire filesystem.

https://issues.apache.org/jira/browse/HADOOP-498?jql=text%20~%20%22fsck%22