Hadoop - HDFS - 用于查看文件如何拆分的命令

时间:2015-03-19 11:23:19

标签: hadoop hdfs

Hadoop FsShell(或hdfs命令)中是否有命令行来查看文件的拆分或查看文件在放入HDFS时如何在数据节点上拆分?

1 个答案:

答案 0 :(得分:1)

hdfs fsck似乎就是你所追求的:

$ hdfs fsck /import/collections/part-00000 -files -blocks
Connecting to namenode via http://vm28-hulk-priv:50070
FSCK started by usrhadoop (auth:SIMPLE) from /10.237.241.28 for path /import/collections/part-00000 at Thu Mar 19 07:35:15 EDT 2015
/import/collections/part-00000 3620228 bytes, 1 block(s):  OK
0. BP-1201623000-10.237.241.28-1421858661680:blk_1074635302_894483 len=3620228 repl=3

Status: HEALTHY
 Total size:    3620228 B
 Total dirs:    0
 Total files:   1
 Total symlinks:                0
 Total blocks (validated):      1 (avg. block size 3620228 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:          4
 Number of racks:               1
FSCK ended at Thu Mar 19 07:35:15 EDT 2015 in 1 milliseconds


The filesystem under path '/import/collections/part-00000' is HEALTHY