728x90

배경 )

 

호스트명 test1, test2 --> namenode 이중화

 

 

 

현상 )

 

1. 정상동작

test1 test2
active standby

 

 

일 때, 

test1 namenode stop

-->

test2 namenode active 정상 변경 완료

 

 

 

 

2. 비정상동작

 

test1 test2
standby active

 

일 때, 

test2 namenode stop

-->

test1 namenode active 변경 실패. (standby상태 유지)

 

 

 

2-1. 

위의 상태에서, 

test2 namenode start 시 

test1, test2 모두 standby 상태.

 

 


 

 

해결 )

 

1번 현상에서 failover가 정상동작하는걸로 보아, 

zkfc 실행 자체에는 문제가 없다고 판단, 

fencing 작업에 문제 가능성 발견.

 

 

 

test1의 

zkfc logs 파일 ( hadoop-유저명-zkfc-test2.log )  에서

 

 

 

 PATH=$PATH:/sbin:/usr/sbin fuser -v -k -n tcp 8020 via ssh: bash: fuser: command not found

 

fuser의 command not found 발견 !

 

--> test1 내 fuser 설치해주기. 

# yum -y install psmisc

참고 : https://coconuts.tistory.com/730

 

CentOS fuser 명령어 개요 fuser command not found 해결방법

fuser command not found on centos 리눅스에서 fuser는 특정파일 또는 프로세스의 사용자를 알고자 할 때 사용합니다. 저 같은 경우에는 어떤 대상에 대해서 명령어가 동작하지 않을 때 어떤 유저나 프로

coconuts.tistory.com

 

 

 

 

 

 


정리 ) 

 

1. test1, test2 에서 zkfc가 각각의 실행상태를 바라보고있을 때, 

2. test1 이 종료되어

3. test2를 zkfc가 standby  -->  active상태로 변경하기 위해

4. test1 에 접속시도를 할 때, fuser 사용.   --> split brain 현상 발생

5. test1 fuser 설치

6. 해결완료

 

 

 

 

Sol2 ) 

https://hadoop.apache.org/docs/r3.2.2/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html

 

Apache Hadoop 3.2.2 – HDFS High Availability

<!--- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a

hadoop.apache.org

 

 

sshfence 로 설정했을 시 

1. 이 포스팅 내용과 같이 패키지설치가 안되어 오류가 나거나, 

2. 누가 랜선을 뽑으면 ssh 연결이 안되어 오류가 날 수 있다. 

 

이를 방지하기 위해 

 

다양한 옵션이 있는데

 

shell 로 옵션을 주면, 

연결 시 True 값을 반환하며 연결 완료를 확인할 수 있다. 

 

 

 

 

Sol3)

sshfence 와 shell 옵션을 둘 다 주어

sshfence 로 연결이 완료될 때까지 timeout 상태로 대기 후

shell 의 True 로 연결을 확인하는 방법도 있다 !

 

+ Recent posts