본문 바로가기
반응형
Data/Big Data

[Hadoop] HDFS missing block error 해결

by JAMINS 2023. 4. 7.

CDH 호스트 추가하다 HDFS에 Missing block error가 발생함

어떤 파일이 손상됐는지 hdfs fsck 커맨드로 점검

hdfs fsck /user/test

결과 값은 아래와 같다

/user/test/sample/a.c000.snappy.parquet: MISSING 1 blocks of total size 3281 B..
/user/test/sample/b.c000.snappy.parquet: CORRUPT blockpool BP-1946097349-10.105.5.32-1529396520190 block blk_1152928797
/user/test/sample/c.c000.snappy.parquet: MISSING 1 blocks of total size 3301 B...
/user/test/sample/d.c000.snappy.parquet:  Under replicated BP-1946097349-10.105.5.32-1529396520190:blk_1152919246_79178676. Target Replicas is 3 but found 2 live replica(s), 0 decommissioned replica(s), 0 decommissioning replica(s).

해결방법

  • 삭제
  • 복제

1. 삭제

hdfs fsck -delete /user/test

2. 복제

문제되는 파일의 복제 계수 1개인 block들을 replication factor 만큼 복제

hadoop fs -setrep 3 -R /user/test/sample

댓글