문서유형ㅣ기술정보
분야ㅣ설치
적용제품버전ㅣ7FS04PS
문서번호ㅣTINTI047
개요
방법
13. Standby CM 등록 및 resource 등록
13.1 Standby CM 기동
$ su - tibero $ tbcm -b CM Guard daemon started up. import resources from '/home/tibero/tibero7/config/cm_res'... TBCM 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager started up. Local node name is (STANDBY:18632).
13.2 리소스 등록
13.2.1 private network 등록
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
NO RESOURCE
=====================================================================
$ cmrctl add network --name net1 --ipaddr 172.16.59.111 --portno 29000
Resource add success! (network, net1)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
=====================================================================13.2.2 public network 등록
$ cmrctl add network --name pub1 --nettype public --ifname ens33
Resource add success! (network, pub1)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
=====================================================================
13.2.3 cluster 등록
$ cmrctl add cluster --name cls1 --incnet net1 --pubnet pub1 --cfile /home/tibero/tibero7/config/cls1_cfile
Resource add success! (cluster, cls1)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 DOWN inc: net1, pub: pub1
=====================================================================
13.2.4 cluster 기동
$ cmrctl start cluster --name cls1
MSG SENDING SUCCESS!
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 UP inc: net1, pub: pub1
cls0 file cls1:0 UP /home/tibero/tibero7/config/cls1_cfile
=====================================================================
13.2.5 service 등록
$ cmrctl add service --name tsc --cname cls0 --tscid 11 --obsip 172.16.59.111 --obsport 9050
Resource add success! (service, tsc)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 UP inc: net1, pub: pub1
cls0 file cls1:0 UP /home/tibero/tibero7/config/cls1_cfile
cls0 service tsc DOWN Database, Active Cluster (auto-restart: OFF)
=====================================================================
13.2.6 DB 등록
$ cmrctl add db --name tsc_S --svcname tsc --dbhome /home/tibero/tibero7 --envfile /home/tibero/.bash_profile
Resource add success! (db, tsc_S)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 UP inc: net1, pub: pub1
cls0 file cls1:0 UP /home/tibero/tibero7/config/cls1_cfile
cls0 service tsc DOWN Database, Active Cluster (auto-restart: OFF)
cls0 db tsc_S DOWN tsc, /home/tibero/tibero7, failed retry cnt: 0
=====================================================================
13.2.7 vip 등록
$ cmrctl add vip --name vip1 --node STANDBY --svcname tsc --ipaddr 192.168.41.117/255.255.255.0 --bcast 192.168.41.255
Resource add success! (vip, vip1)
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 UP inc: net1, pub: pub1
cls0 file cls1:0 UP /home/tibero/tibero7/config/cls1_cfile
cls0 service tsc DOWN Database, Active Cluster (auto-restart: OFF)
cls0 db tsc_S DOWN tsc, /home/tibero/tibero7, failed retry cnt: 0
cls0 vip vip1 DOWN tsc, 192.168.41.117/255.255.255.0/192.168.41.255 (1)
failed retry cnt: 0
=====================================================================
주의
root 계정에서 tbcm process 기동, tibero 계정에서 tibero process 기동해야 vip up 됩니다.
14. Standby CM & DB 기동
14.1 Standby CM 재기동
vip 사용을 위해서 CM을 root 계정에서 기동합니다. (vip 사용하지 않는다면 이 절차는 무시하셔도 됩니다.)
$ su - tibero $ tbcm -d CM DOWN SUCCESS! $ su - $ cd ~tibero 혹은 cd /home/tibero ($TB_HOME 경로로 이동) $ . .bash_profile $ tbcm -b CM Guard daemon started up. import resources from '/home/tibero/tibero7/config/cm_res'... TBCM 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager started up. Local node name is (STANDBY:18632).
14.2 Standby DB mount 기동
Standby DB를 recovery 모드로 기동하기 전에 Primary DB에서 가져온 컨트롤 파일을 standby DB 것으로 변경해주는 작업이 필요합니다.
$ su - tibero $ tbboot mount Change core dump dir to /home/tsc_tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (MOUNT mode). $ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter database standby controlfile; Database altered. SQL> q Disconnected. $ tbdown immediate Tibero instance terminated (IMMEDIATE mode).
14.3 Standby DB recovery 기동
$ tbboot recovery Change core dump dir to /home/tsc_tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (RECOVERY mode).
15. Primary CM & DB 기동
15.1 Primary CM 기동
vip 사용을 위해서 CM을 root 계정에서 기동합니다. (vip 사용하지 않는다면 이 절차는 무시하셔도 됩니다.)
$ su - tibero $ tbcm -d CM DOWN SUCCESS! $ su - $ cd ~tibero 혹은 cd /home/tibero ($TB_HOME 경로로 이동) $ . .bash_profile $ tbcm -b CM Guard daemon started up. import resources from '/home/tibero/tibero7/config/cm_res'... TBCM 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager started up. Local node name is (PRIMARY:18632).
15.2 Primary DB 기동
$ su - tibero $ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode).
16. TSC 동기화 확인
Standby DB 에서 테스트 테이블을 조회하여 확인합니다.
$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> alter database open read only continue recovery;
Database altered.
SQL> select count(*) from tibero.tsc_sync_test;
COUNT(*)
----------
99
1 row selected.
TSC 상태 확인
1.1 Observer와 연결 상태 확인
Observer CM에서 PRIMARY, STANDBY 연결 상태를 확인할 수 있습니다.
$ su - obs
$ cmrctl show
Resource List of Observer OBSERVER
===================================================================
TSC_ID CLS_ID CM_NAME NID CM_STAT INST_STAT PRI/TAR
-------- -------- ----------- ----- --------- ----------- ---------
11 4 STANDBY 1 UP UP(RONY) TARGET
3 PRIMARY 1 UP UP(NRML) PRIMARY
===================================================================
$ cmrctl show --tscid 11
TSC(ID: 11) Information
==============================================================================================
FAILOVER MODE CLS_ID CM_NAME CONN LOG Heartbeat RCVD.TSN
---------- -------------- -------- ----------- ------ ----- ------------- --------------------
ON(TSN) PROTECTIVE 1 STANDBY Y(M) 1 60 45426
0 PRIMARY Y(M) - 60 0
==============================================================================================
1.2 Primary DB connect 확인
Primary DB에서 v$standby_dest 테이블 조회하여 확인할 수 있습니다.
$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. select flags from v$standby_dest; FLAGS -------------------------------- CONNECTED
1.3 VIP 상태 확인
TSC 구성에서 vip는 Active 중인 서버에서만 기동됩니다.
- Primary node가 up이면 Standby node는 down
- Failover 시에는 Standby node가 up 상태로 변경
$ cmrctl show
Resource List of Node PRIMARY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net0 UP (private) 172.16.59.110/29000
COMMON network pub0 UP (public) ens33
COMMON cluster cls0 UP inc: net0, pub: pub0
cls0 file cls0:0 UP /home/tibero/tibero7/config/cls0_cfile
cls0 service tsc UP Database, Active Cluster (auto-restart: OFF)
cls0 db tsc_P UP(NRML) tsc, /home/tibero/tibero7, failed retry cnt: 0
cls0 vip vip0 UP tsc, 192.168.41.117/255.255.255.0/192.168.41.255 (1)
failed retry cnt: 0
=====================================================================
$ cmrctl show
Resource List of Node STANDBY
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
----------- -------- -------------- -------- ------------------------
COMMON network net1 UP (private) 172.16.59.111/29000
COMMON network pub1 UP (public) ens33
COMMON cluster cls1 UP inc: net1, pub: pub1
cls1 file cls1:0 UP /home/tibero/tibero7/config/cls1_cfile
cls1 service tsc UP Database, Active Cluster (auto-restart: OFF)
cls1 db tsc_S UP(RONY) tsc, /home/tibero/tibero7, failed retry cnt: 0
cls1 vip vip1 DOWN tsc, 192.168.41.117/255.255.255.0/192.168.41.255 (1)
failed retry cnt: 0
=====================================================================
Observer 모드
observer 모드는 PROTECTIVE, DISASTER_PLAN 2가지가 있습니다. 기본적으로 cm 기동 시에는 PROTECTIVE 모드가 적용되며, DISASTER_PLAN 모드를 사용하기 위해선 observer를 재기동 할때마다 수동으로 변경해주어야 합니다.
| 구분 | 설명 |
|---|---|
| PROTECTIVE | Primary db에 문제가 발생한 경우 failover 진행 (db 종료 시) |
| DISASTER_PLAN | Primary cluster에 문제가 발생한 경우 failover 진행 (cm, db 비정상 종료 시) |
Observer 모드 변경
모드 변경을 위해선 다음과 같이 수행합니다.
$ su - obs
$ cmrctl show
Resource List of Observer OBSERVER
===================================================================
TSC_ID CLS_ID CM_NAME NID CM_STAT INST_STAT PRI/TAR
-------- -------- ----------- ----- --------- ----------- ---------
11 4 STANDBY 1 UP UP(RONY) TARGET
3 PRIMARY 1 UP UP(NRML) PRIMARY
===================================================================
$ cmrctl show --tscid 11
TSC(ID: 11) Information
==============================================================================================
FAILOVER MODE CLS_ID CM_NAME CONN LOG Heartbeat RCVD.TSN
---------- -------------- -------- ----------- ------ ----- ------------- --------------------
ON(TSN) PROTECTIVE 1 STANDBY Y(M) 1 60 45426
0 PRIMARY Y(M) - 60 0
==============================================================================================
$ cmrctl set --tscid 11 --mode disaster_plan
SUCCESS!
$ cmrctl show --tscid 11
TSC(ID: 11) Information
==============================================================================================
FAILOVER MODE CLS_ID CM_NAME CONN LOG Heartbeat RCVD.TSN
---------- -------------- -------- ----------- ------ ----- ------------- --------------------
ON(TSN) DISASTER_PLAN 1 STANDBY Y(M) 1 60 45638
0 PRIMARY Y(M) - 60 0
==============================================================================================
TSC 기동 및 종료
1. 기동 절차
1.1 Observer
$ su - obs $ tbcmobs -b TBCM OBSERVER MODE 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager observer started up. Local observer name is (OBSERVER:28632).
1.2 Standby
$ su - $ cd ~tibero 혹은 cd /home/tibero ($TB_HOME 경로로 이동) $ . .bash_profile $ tbcm -b CM Guard daemon started up. import resources from '/home/tibero/tibero7/config/cm_res'... TBCM 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager started up. Local node name is (STANDBY:18632). $ su - tibero $ tbboot recovery Change core dump dir to /home/tsc_tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (RECOVERY mode).
1.3 Primary
$ su - $ cd ~tibero 혹은 cd /home/tibero ($TB_HOME 경로로 이동) $ . .bash_profile $ tbcm -b CM Guard daemon started up. import resources from '/home/tibero/tibero7/config/cm_res'... TBCM 7.1.1 (Build 303667) TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero cluster manager started up. Local node name is (PRIMARY:18632). $ su - tibero $ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode).
2. 종료 절차
2.1 Observer
$ su - obs $ tbcm -d CM DOWN SUCCESS!
2.2 Standby
$ su - tibero $ tbdown immediate Tibero instance terminated (IMMEDIATE mode). $ tbcm -d Tibero instance terminated (IMMEDIATE mode).
2.3 Primary
$ su - tibero $ tbdown immediate Tibero instance terminated (IMMEDIATE mode). $ tbcm -d Tibero instance terminated (IMMEDIATE mode).