hdfs中Missing Block 的文件处理方法

今天巡检的时候发现很多Missing Block信息,大概有1千多个,基本上是error文件,我针对一个文件进行fsck,如下信息:

[root@nn ~]# hdfs fsck /kafka/kafka-sample/history/2014/errors-m-00003 -files -blocks -racks -locations
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Connecting to namenode via http://nn-resourcemanager.21:50070
FSCK started by root (auth:SIMPLE) from /192.168.2.101 for path /kafka/kafka-sample/history/2014/errors-m-00003 at Fri Aug 28 16:46:32 CST 2015
/kafka/kafka-sample/history/2014/errors-m-00003 166 bytes, 1 block(s):
/kafka/kafka-sample/history/2014/errors-m-00003: CORRUPT blockpool BP-1013849047-192.168.2.100-1413787589090 block blk_1073742241
 MISSING 1 blocks of total size 166 B
0. BP-1013849047-192.168.2.100-1413787589090:blk_1073742241_1417 len=166 MISSING!

Status: CORRUPT
 Total size:    166 B
 Total dirs:    0
 Total files:   1
 Total symlinks:                0
 Total blocks (validated):      1 (avg. block size 166 B)
  ********************************
  CORRUPT FILES:        1
  MISSING BLOCKS:       1
  MISSING SIZE:         166 B
  CORRUPT BLOCKS:       1
  ********************************
 Minimally replicated blocks:   0 (0.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:     0.0
 Corrupt blocks:                1
 Missing replicas:              0
 Number of data-nodes:          25
 Number of racks:               1
FSCK ended at Fri Aug 28 16:46:32 CST 2015 in 4 milliseconds


使用命令清楚这些Missing Block
hdfs dfs -delete
这个命令只是删除没有Block信息的文件,不会删除其他问题,可以放心使用。

删除后检查下
hdfs dfs /
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值