HDFS文件系统如何查看文件对应的block

查看数: 104196 | 评论数: 6 | 收藏 6
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2014-5-4 23:20

正文摘要:

问题导读: 1.文件与block的信息被保存在什么文件中? 2.如何查看整个目录树? 3.可以通过什么方式查看文件与block的对应关系? (1)文件分割后,会有一个  文件 --> block的映射,这个 ...

回复

zouzhi 发表于 2017-4-6 22:38:40
又看了一遍
linian_hadoop 发表于 2016-5-19 11:55:08
tsyzzxq 发表于 2015-12-23 02:36
**** 作者被禁止或删除 内容自动屏蔽 ****

我的怎么没有类似于这一行:
0. BP-907579389-192.168.2.136-1450397645134:blk_1073741856_1032 len=162 repl=2

显示内容如下:
[hadoop@master ~]$ hadoop fsck /user/hadoop/sort/data -file -blocks
FSCK started by hadoop from /192.168.80.100 for path /user/hadoop/sort/data at Thu May 19 11:50:53 CST 2016
.Status: HEALTHY
Total size: 36 B
Total dirs: 0
Total files: 1
Total blocks (validated): 1 (avg. block size 36 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 May 19 11:50:53 CST 2016 in 1 milliseconds


The filesystem under path '/user/hadoop/sort/data' is HEALTHY


tsyzzxq 发表于 2015-12-23 02:36:02
斑竹:hadoop fsck filename -file -blocks不是可以查看文件对应的块吗?

/user/hive/warehouse/userdb.db/employ/employee1.txt 162 bytes, 1 block(s):  OK
0. BP-907579389-192.168.2.136-1450397645134:blk_1073741856_1032 len=162 repl=2

Status: HEALTHY
Total size:    162 B
Total dirs:    0
Total files:   1
Total symlinks:                0
Total blocks (validated):      1 (avg. block size 162 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:    2
Average block replication:     2.0
Corrupt blocks:                0
Missing replicas:              0 (0.0 %)
Number of data-nodes:          2
Number of racks:               1
FSCK ended at Sat Dec 19 19:42:19 CST 2015 in 36 milliseconds


BP-1619066087-192.168.2.136-1450190319876为该namenode对应的blockpoolid
blk_1073741864_1040为指定文件对应的BLOCK元数据名称,如果有多个BLOCK会显示多个
guotong1988 发表于 2015-10-26 11:39:28
好文啊!!!!!!!!!
fullmetal 发表于 2015-7-23 22:45:47
这么艰涩我居然看完了
关闭

推荐上一条 /2 下一条