You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Hemanth Makkapati <ma...@vt.edu> on 2011/12/24 19:10:58 UTC

Block Location Information

Hi,

In HDFS, how do I find out what are all the blocks that belong to a
particular file and where each one of these blocks (incl. the replicas) is
located?

Thank you.

Regards,
Hemanth Makkapati

Re: Block Location Information

Posted by Hemanth Makkapati <ma...@vt.edu>.
Hi Harsh,

Thank you!
This is exactly what I wanted.

Happy Holidays!

Regards,
Hemanth Makkapati

On Sat, Dec 24, 2011 at 10:11 PM, Harsh J <ha...@cloudera.com> wrote:

> You need:
> http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getFileBlockLocations(org.apache.hadoop.fs.FileStatus
> ,
> long, long)
>
> On Sat, Dec 24, 2011 at 11:40 PM, Hemanth Makkapati <ma...@vt.edu> wrote:
> > Hi,
> >
> > In HDFS, how do I find out what are all the blocks that belong to a
> > particular file and where each one of these blocks (incl. the replicas)
> is
> > located?
> >
> > Thank you.
> >
> > Regards,
> > Hemanth Makkapati
>
>
>
> --
> Harsh J
>

Re: Block Location Information

Posted by Harsh J <ha...@cloudera.com>.
You need: http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getFileBlockLocations(org.apache.hadoop.fs.FileStatus,
long, long)

On Sat, Dec 24, 2011 at 11:40 PM, Hemanth Makkapati <ma...@vt.edu> wrote:
> Hi,
>
> In HDFS, how do I find out what are all the blocks that belong to a
> particular file and where each one of these blocks (incl. the replicas) is
> located?
>
> Thank you.
>
> Regards,
> Hemanth Makkapati



-- 
Harsh J

Re: Block Location Information

Posted by Anirudh <te...@gmail.com>.
Hi Hemanth,

You can view this on your browser pointing to your HTTP server on NN.
http://NN_servername:50070

50070 is the default port, unless you have given it some other value in
your configuration.
Navigate to the directory where your file is and click on the file. You
will be shown all the information about the blocks on the page.

Alternatively, you can try the fsck command
hadoop fsck file_path -files -blocks -racks

Thanks,
Anirudh

On Sat, Dec 24, 2011 at 10:10 AM, Hemanth Makkapati <ma...@vt.edu> wrote:

> Hi,
>
> In HDFS, how do I find out what are all the blocks that belong to a
> particular file and where each one of these blocks (incl. the replicas) is
> located?
>
> Thank you.
>
> Regards,
> Hemanth Makkapati
>