Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |
Tags
- CRT
- Keygen
- pyhive
- OOM
- encoding
- Celery
- kerberosClient
- executor
- python2
- OpenSSL
- Linux
- webhdfs
- ssh
- distcp
- hadoop
- kerberos
- install
- OutOfMemory
- Python
- python3
- PFX
- unquote
- setdefault
- hive
- supserset
- airflow
- Spark
Archives
- Today
- Total
복싱하는_개발자.dev
[Cloudera] datanode 누락된 블록 본문
클라우데라 운영 중 하둡 작업 시, 무거운 작업을 돌리는 도중에 갑자기 HDFS 쪽에 빨간불(?)이 뜨면서 누락된 블록 이슈 발생
정확한 에러는 아래와 같았다.
The health test result for HDFS_MISSING_BLOCKS has become bad: 1 missing blocks in the cluster.
4,274,612 total blocks in the cluster.
Percentage missing blocks: 0.00%. Critical threshold: any......
클러스터는 3개의 복제본을 가지고 있고, 데이터 노드에 나눠서 저장하는데 이 때 제대로 작업이 이루어지지 않아 발생하는 것으로 보임.
그렇다면 namenode로 가서 진짜 괜찮은지 확인해보자
# 하둡명령어를 이용하여 현재 하둡상태 확인하는 명령어
hdfs dfsadmin -report
~ 정상 일 경우 ~
Configured Capacity: 5***** (**.72 TB)
Present Capacity: 5***** (**.71 TB)
DFS Remaining: 37**** (**.35 TB)
DFS Used: *** (**.36 TB)
DFS Used%: 29.11%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0
~~~~~~~~~~~~~~~~~~~~~~~~~
# 이때 Missing blocks, Under replicated blocks 의 값들이 0이 아니라면 블록/노드에 문제가 있는것!
아무리 그래도 믿지(?) 못하겠다면 하둡의 시스템을 검사해주는 fsck 명령어를 사용하기
# hdfs 로 user 변경 후 hdfs fsck / 를 하겠다는 명령어
sudo -u hdfs hdfs fsck /
그러면 갑자기 화면에 "." 점들이 쭉 찍히다가 하둡의 상태를 나타내준다.
이 때 확인 해야 할 것은 corrupt blocks 이다.
...
Over-replicated blocks: 0
Under-replicated blocks: 0
Mis-replocated blocks: 0
Default replication factor: 3
Average block replication: 3.000
Corrupt blocks: 0
Missing replicas: 0
...
아마 이상이 있으면 Corrupt blocks 가 1 이상의 값을 가질 것이다. (위는 정상일 경우 출력이다)
이제 블록에 이상이 있는 것을 알았으니 누락되어 잘못 저장된 블록들을 지워야 한다.
# hdfs 시스템에서 에서 Replica 블록 확인
hdfs fsck / | egrep -v '^\.+ | grep -v replica | grep -v Replica (Namenode 일 경우)
or
hdfs fsck hdfs://ip.or.host:50070/ | egrep -v '^\.+ | grep -v replica | grep -v Replica (Namenode 가 아닐 경우)
# 위 명령어를 치고 나면 에러가 있는 블록과 파일명이 결과로 나온다..!
/path/to/filename.fileextension: CORRUPT blockpool BP-1016133662-10.29.100.41-1415825958975 block blk_1073904305/path/to/filename.
fileextension: MISSING 1 blocks of total size 15620361 B
# 그러면 문제가 있는 이 파일들을 지우면 된다!!
hdfs dfs -rm /path/to/filename.fileextension (Namenode 일 경우)
hdfs dfs -rm hdfs://ip.or.hostname.of.namenode:50070/path/to/filename.fileextension (Namenode 가 아닐 경우)
# 위 명령어들로 문제가 있는 파일들을 먼저 지워주고
# 아래 명령어로 블록을 지워주면 된다!
hdfs fsck / -delete
# 그 이후 cloudera manager UI 에서 새로고침을 해보자-
클라우데라 Web UI 를 새로 고침 해보면 아마 빨간불이 안정적인 초록불로 바뀌었을 것이다.!
ref.
https://stackoverflow.com/questions/40214658/hdfs-fsck-permission-denied
https://stackoverflow.com/questions/19205057/how-to-fix-corrupt-hdfs-files
'Hadoop' 카테고리의 다른 글
| [hadoop] 기존 하둡 클러스터에서 신규 클러스터로 config 설정 (0) | 2022.03.31 |
|---|---|
| [hadoop] 하둡간 복사(distcp) & 버전별 포트 (0) | 2022.03.02 |
Comments