Hadoop中檢視一個檔案位置資訊

GeoWin_CAS發表於2015-04-15

命令列

hadoop fsck /user/filename -files  -blocks -locations -racks

-files  檔案分塊資訊,
-blocks    在帶-files引數後才顯示block資訊
-locations   在帶-blocks引數後才顯示block塊所在datanode的具體IP位置,
-racks       在帶-files引數後顯示機架位置

結果

Connecting to namenode via http://master:50070
FSCK started by guest (auth:SIMPLE) from /10.2.173.15 for path /user/guest/esri/cdsjson at Mon Jun 28 14:33:30 HKT 2004
/user/guest/esri/cdsjson <dir>
/user/guest/esri/cdsjson/cdsjson.json 5222672619 bytes, 39 block(s):  OK
0. BP-192413424-10.2.173.15-1417348404697:blk_1073812659_71971 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
1. BP-192413424-10.2.173.15-1417348404697:blk_1073812660_71972 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
2. BP-192413424-10.2.173.15-1417348404697:blk_1073812661_71973 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
3. BP-192413424-10.2.173.15-1417348404697:blk_1073812662_71974 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
4. BP-192413424-10.2.173.15-1417348404697:blk_1073812663_71975 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
5. BP-192413424-10.2.173.15-1417348404697:blk_1073812664_71976 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
6. BP-192413424-10.2.173.15-1417348404697:blk_1073812665_71977 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
7. BP-192413424-10.2.173.15-1417348404697:blk_1073812666_71978 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
8. BP-192413424-10.2.173.15-1417348404697:blk_1073812667_71979 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
9. BP-192413424-10.2.173.15-1417348404697:blk_1073812668_71980 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
10. BP-192413424-10.2.173.15-1417348404697:blk_1073812669_71981 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
11. BP-192413424-10.2.173.15-1417348404697:blk_1073812670_71982 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
12. BP-192413424-10.2.173.15-1417348404697:blk_1073812671_71983 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
13. BP-192413424-10.2.173.15-1417348404697:blk_1073812672_71984 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
14. BP-192413424-10.2.173.15-1417348404697:blk_1073812673_71985 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
15. BP-192413424-10.2.173.15-1417348404697:blk_1073812674_71986 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
16. BP-192413424-10.2.173.15-1417348404697:blk_1073812675_71987 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
17. BP-192413424-10.2.173.15-1417348404697:blk_1073812676_71988 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
18. BP-192413424-10.2.173.15-1417348404697:blk_1073812677_71989 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
19. BP-192413424-10.2.173.15-1417348404697:blk_1073812678_71990 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
20. BP-192413424-10.2.173.15-1417348404697:blk_1073812679_71991 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
21. BP-192413424-10.2.173.15-1417348404697:blk_1073812680_71992 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
22. BP-192413424-10.2.173.15-1417348404697:blk_1073812681_71993 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
23. BP-192413424-10.2.173.15-1417348404697:blk_1073812682_71994 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
24. BP-192413424-10.2.173.15-1417348404697:blk_1073812683_71995 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
25. BP-192413424-10.2.173.15-1417348404697:blk_1073812684_71996 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
26. BP-192413424-10.2.173.15-1417348404697:blk_1073812685_71997 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
27. BP-192413424-10.2.173.15-1417348404697:blk_1073812686_71998 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
28. BP-192413424-10.2.173.15-1417348404697:blk_1073812687_71999 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
29. BP-192413424-10.2.173.15-1417348404697:blk_1073812688_72000 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
30. BP-192413424-10.2.173.15-1417348404697:blk_1073812689_72001 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
31. BP-192413424-10.2.173.15-1417348404697:blk_1073812690_72002 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
32. BP-192413424-10.2.173.15-1417348404697:blk_1073812691_72003 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
33. BP-192413424-10.2.173.15-1417348404697:blk_1073812692_72004 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
34. BP-192413424-10.2.173.15-1417348404697:blk_1073812693_72005 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
35. BP-192413424-10.2.173.15-1417348404697:blk_1073812694_72006 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
36. BP-192413424-10.2.173.15-1417348404697:blk_1073812695_72007 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
37. BP-192413424-10.2.173.15-1417348404697:blk_1073812696_72008 len=134217728 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]
38. BP-192413424-10.2.173.15-1417348404697:blk_1073812697_72009 len=122398955 repl=3 [/default-rack/10.2.173.53:50010, /default-rack/10.2.173.22:50010, /default-rack/10.2.173.157:50010]

Status: HEALTHY
 Total size: 5222672619 B
 Total dirs: 1
 Total files: 1
 Total symlinks:  0
 Total blocks (validated): 39 (avg. block size 133914682 B)
 Minimally replicated blocks: 39 (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 Jun 28 14:33:30 HKT 2004 in 2 milliseconds

相關文章