如果有坏的数据块,处理方式两种
方法一、直接删除坏的数据块
方法二、修复坏的数据块
1、检测路径下是否有坏块:
bin/hdfs fsck /
2、删除路径下的坏块:
bin/hdfs fsck / -delete
3、修复坏块:
hdfs debug recoverLease -path / -retries 5
###retries 为重试次数
########Corrupt blocks表示坏掉的块
4、坏的数据块;
/vul/file/old/9/file: MISSING 1 blocks of total size 10315 B.Status: CORRUPT
Total size: 596245766 B
Total dirs: 570
Total files: 758
Total symlinks: 0
Total blocks (validated): 660 (avg. block size 903402 B)
UNDER MIN REPL’D BLOCKS: 660 (100.0 %)
dfs.namenode.replication.min: 1
CORRUPT FILES: 660
MISSING BLOCKS: 660
MISSING SIZE: 596245766 B
CORRUPT BLOCKS: 660
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: 660
Missing replicas: 0
Number of data-nodes: 1
Number of racks: 1
FSCK ended at Tue Dec 31 10:02:48 CST 2019 in 2844 milliseconds
The filesystem under path ‘/’ is CORRUPT