hdfs 出现坏块

 hdfs fsck /

先用该命令检测存在哪些坏块

  ********************************
  CORRUPT FILES:    28
  MISSING BLOCKS:    28
  MISSING SIZE:        1078476 B
  CORRUPT BLOCKS:     28
  ********************************
 Minimally replicated blocks:    3 (9.67742 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    0 (0.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    1
 Average block replication:    0.09677419
 Corrupt blocks:        28
 Missing replicas:        0 (0.0 %)
 Number of data-nodes:        1
 Number of racks:        1
FSCK ended at Thu Jul 07 12:10:08 CST 2016 in 11 milliseconds


The filesystem under path '/' is CORRUPT

然后发现坏块所在路径,执行下列命令删除坏块

hdfs fsck  / -delete

再次检测坏块,发现已经不存在坏块

FSCK started by hadoop (auth:SIMPLE) from /192.168.56.200 for path / at Thu Jul 07 12:15:34 CST 2016
...Status: HEALTHY
 Total size:    163749 B
 Total dirs:    20
 Total files:    3
 Total symlinks:        0
 Total blocks (validated):    3 (avg. block size 54583 B)
 Minimally replicated blocks:    3 (100.0 %)
 Over-replicated blocks:    0 (0.0 %)
 Under-replicated blocks:    0 (0.0 %)
 Mis-replicated blocks:        0 (0.0 %)
 Default replication factor:    1
 Average block replication:    1.0
 Corrupt blocks:        0
 Missing replicas:        0 (0.0 %)
 Number of data-nodes:        1
 Number of racks:        1
FSCK ended at Thu Jul 07 12:15:34 CST 2016 in 5 milliseconds


The filesystem under path '/' is HEALTHY


你可能感兴趣的:(Apache,Hadoop)