Hadoop 查看某个文件分成几个块,分别在那台机架的哪个机器上

hadoop fsck /usr/input/a.txt -files -blocks -locations -racks

[root@node1 sbin]# hadoop fsck /usr/input/a.txt -files  -blocks -locations -racks
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Connecting to namenode via http://node1:50070
FSCK started by root (auth:SIMPLE) from /192.168.88.128 for path /usr/input/a.txt at Mon Oct 03 05:14:10 CST 2016
/usr/input/a.txt 10 bytes, 1 block(s):  OK
0. BP-703567924-192.168.88.128-1455139267725:blk_1073742302_1478 len=10 repl=3 [/default-rack/192.168.88.130:50010, /default-rack/192.168.88.129:50010, /default-rack/192.168.88.131:50010]

Status: HEALTHY
 Total size:	10 B
 Total dirs:	0
 Total files:	1
 Total symlinks:		0
 Total blocks (validated):	1 (avg. block size 10 B)
 Minimally replicated blocks:	1 (100.0 %)
 Over-replicated blocks:	0 (0.0 %)
 Under-replicated blocks:	0 (0.0 %)
 Mis-replicated blocks:		0 (0.0 %)
 Default replication factor:	3
 Average block replication:	3.0
 Corrupt blocks:		0
 Missing replicas:		0 (0.0 %)
 Number of data-nodes:		3
 Number of racks:		1
FSCK ended at Mon Oct 03 05:14:10 CST 2016 in 17 milliseconds


The filesystem under path '/usr/input/a.txt' is HEALTHY


你可能感兴趣的:(Hadoop-HDFS)