HA 구성시 MASTER 서버 접속 실패 상황

by nagh posted May 06, 2020

* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.
OS
Linux64bit Centos7
CUBRID Ver.
Cubrid 9.3
CUBRID TOOL Ver.
[도움말]-[버전정보] 확인
응용 환경(API)
java

* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.
에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축


-------------- 아래에 질문 사항을 기입해 주세요. ------------------------------------------------------------------------
안녕하세요


HA 구성 후 마스터서버에 접속을 실패하고 로컬에 접속되어 Read only로만 작동되는 현상이 발생했습니다.


db명과 node명은 편의상 test로 치환하였습니다.

- db명 : test

- node명 : test1 (master) , test2(slave)

- HA 구성 : databases.txt 파일에만 ~ host test1:test2 순으로 접속하도록 설정

- Broker test1, test2 모두 실행

- jdbc-url : jdbc:cubrid:localhost:30000:test:::?charset=utf-8 각각 broker에 접속하도록 설정 (alhost 사용하지 않음)

- 기동시 절차에 문제가 있었는지 test2가 master로 기동 test1이 slave로 기동

- test2가 master로 설정되어도 databases.txt파일에 정보에따라 test2(master)로 접속해야 하는데 실패한 것으로 추정


Test1 쪽 broker.err 파일에 해당 로그만 반복으로 발생

Time: 02/22/20 16:28:08.135 - ERROR *** file ../../src/communication/network_cl.c, line 329 ERROR CODE = -1139 Tran = -1, EID = 1

Handshake error (peer host test1): incompatible read/write mode. (client: read/write, server: read only)


Time: 02/22/20 16:28:08.135 - ERROR *** file ../../src/communication/network_cl.c, line 4413 ERROR CODE = -743 Tran = -1, EID = 2

Failed on handshake between client and server. (peer host  test1)


Time: 02/22/20 16:28:08.135 - ERROR *** file ../../src/connection/connection_cl.c, line 757 ERROR CODE = -353 Tran = -1, EID = 3

Cannot make connection to master server on host " test2".... Operation now in progress


Time: 02/22/20 16:28:08.135 - ERROR *** file ../../src/transaction/boot_cl.c, line 1743 ERROR CODE = -677 Tran = -1, EID = 4

Failed to connect to database server, 'test', on the following host(s): test1:test2


Time: 02/22/20 16:28:08.141 - ERROR *** file Unknown from server, line -1 ERROR CODE = -581 Tran = 3, EID = 5

Attempted to update the database when updates are disabled.  


Time: 02/22/20 16:28:08.142 - ERROR *** file ../../src/compat/db_admin.c, line 954 ERROR CODE = -224 Tran = 3, EID = 6

A database has not been restarted.


MASTER_ERR LOG에는 

Time: 02/12/20 14:25:01.947 - ERROR *** file ../../src/executables/master_heartbeat.c, line 3975 ERROR CODE = -989 Tran = -1, EID = 719570

Process event: Registered as local process entries. Success (pid:22364, state:not_registered, args:cub_admin copylogdb -L /home/test/cubrid/databases/test test2 -m sync test@test2)


Time: 02/12/20 14:26:42.079 - ERROR *** file ../../src/executables/master_heartbeat.c, line 3768 ERROR CODE = -989 Tran = -1, EID = 719571

Process event: Process failure detected. (pid:22364, args:cub_admin copylogdb -L /home/test/cubrid/databases/test test2 -m sync test@test2 )


Time: 02/12/20 14:26:43.082 - ERROR *** file ../../src/executables/master_heartbeat.c, line 2688 ERROR CODE = -989 Tran = -1, EID = 719572

Process event: Restart the process. (args:cub_admin copylogdb -L /home/test/cubrid/databases/test test2 -m sync test@test2)




해당 문제 발생 이후 test2 Database를 강제로 다운하여 test1을 master로 돌리자

해당에러가 사라진 후 정상적으로 read/right 수행 가능하였으나 


test2 broker log에서 

Time: 02/26/19 15:39:24.590 - ERROR *** file ../../src/communication/network_cl.c, line 192 ERROR CODE = -199 Tran = 58, EID = 1

Server no longer responding.


Time: 02/26/19 15:39:24.590 - ERROR *** file ../../src/transaction/transaction_cl.c, line 674 ERROR CODE = -111 Tran = 58, EID = 2

Your transaction has been aborted by the system due to server failure or mode change.


Time: 02/26/19 15:39:24.590 - ERROR *** file ../../src/communication/network_cl.c, line 1149 ERROR CODE = -199 Tran = -1, EID = 3

Server no longer responding.


*** The previous error message is the last one. ***


해당 로그가 반복적으로 발생하고 있습니다.  mode change를 주기적으로 시도하는데 왜 인지 모르겠습니다.

Sync 쪽에 문제가 발생한 것으로 보이기는 하는데 정확한 원인을 알 수 가 없네요

재기동 전에는 정상적으로 잘 운영되오던 시스템이었으나 기동 절차에 문제가 있었는지 해당 문제가 발생하여

원인 파악 및 기동 테스트를 재시도 하려고 합니다.

도움 부탁드립니다.





Articles