The Hadoop fsck command is detailed
Hadoop fsck
Usage:dfsck <path> [-move |-delete |-openforwrite] [-files [-blocks [-locations |-racks]]
<path> Check if the files in this directory are complete
-move damaged files to the/lost+found directory
-delete Delete damaged files
-openforwrite printing a file that is opening a write operation
-files Print the file name of the check
-blocks Print block report (need to use with-files parameter)
-locations Print location information for each block (need to be used with the-files parameter)
-racks network topology diagram for printing location information (required with-files parameters)
Hadoop fsck/
Use this command to check the health of the entire file system, but be aware that it does not actively recover the missing blocks of the backup, which is handled asynchronously by namenode separate threads.
....................................................................................................
.................................
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/jifen. Qq. Com.2009-08-13-18.30:replica placement policy is violated for blk_7596595208988121840_5377589. Block should is additionally replicated on 1 more rack (s).
....................................................
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000310/input/pay. Qq. Com.2009-08-13-20.30:replica placement policy is violated for blk_8146588794511444453_5379501. Block should is additionally replicated on 1 more rack (s).
...............
....................................................................................................
....................................................................................................
......................................................................................... Status:HEALTHY
Total size:5042961147529 B (total open files size:1610612736 b)
Total dirs:723
Total files:128089 (Files currently being Written:2)
Total blocks (validated): 171417 (avg. block size 29419259 B) (Total Open file blocks (not validated): 24)
Minimally replicated blocks:171417 (100.0)
over-replicated blocks:0 (0.0)
under-replicated blocks:0 (0.0)
mis-replicated blocks:476 (0.2776854)
Default replication factor:3Default Backup Parameter 3
Average Block replication:3.000146
Corrupt blocks:0Broken block number 0
Missing replicas:0 (0.0)
Number of Data-nodes:107
Number of racks:4
The filesystem under Path '/' is HEALTHY
Hadoop Fsck/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/jifen. Qq. Com.2009-08-13-18.30-files-blocks-locations-racks
The details of each block of this file are printed, including Datanode rack information.
/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/jifen. Qq. com.2009-08-13-18.30 74110492 Bytes, 2 block (s): Replica placement policy is violated for blk_7596595208988121840_537 7589. Block should is additionally replicated on 1 more rack (s). This block, although there are three copies, but in a rack, should have a copy in a different rack, see the previous section (copy placement strategy)
0. blk_-4839761191731553520_5377588 len=67108864 repl=3 [/lg/dminterface0/172.16.236.158:50010,/lg/dminterface1/ 172.16.218.108:50010,/lg/dminterface1/172.16.236.36:50010]
1. blk_7596595208988121840_5377589 len=7001628 repl=3 [/lg/dminterface2/172.16.236.51:50010,/lg/ dminterface2/172.16.218.217:50010,/lg/dminterface2/172.16.218.200:50010]
Three copies of Datanode information, all in/lg/dminterface2.
Status:healthy
Total size:74110492 B
Total dirs:0
Total Files:1
Total blocks (validated): 2 (avg. block size 37055246 B)
Minimally replicated Blocks:2 (100.0)
over-replicated blocks:0 (0.0)
under-replicated blocks:0 (0.0)
Mis-replicated blocks:1 (50.0)
Default Replication Factor:3
Average Block replication:3.0
Corrupt blocks:0
Missing replicas:0 (0.0)
Number of data-nodes:107
Number of Racks:4
The filesystem under Path '/user/distribute-hadoop-boss/tmp/pgv/20090813/1000000103/input/jifen. Qq. com.2009-08-13-18.30 ' is HEALTHY
Reproduced in http://eclecl1314-163-com.iteye.com/blog/1485377
The Hadoop fsck command is detailed