Document TypeㅣTechnical Information
CategoryㅣInstallation
Applicable Product Versionㅣ7FS04PS
Document NumberㅣTINTI047
Overview
Method
13. Register Standby CM and resources
13.1 Start 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 Register resources
13.2.1 Register 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 Register 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 Register 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 Start 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 Register 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 Register 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 Register 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
=====================================================================
Caution
The tbcm process must be started as the root account, and the tibero process must be started as the tibero account for the VIP to be up.
14. Start Standby CM & DB
14.1 Restart Standby CM
To use VIP, start CM as the root account. (If you do not use VIP, you can skip this step.)
$ su - tibero $ tbcm -d CM DOWN SUCCESS! $ su - $ cd ~tibero or cd /home/tibero (navigate to $TB_HOME path) $ . .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 Start Standby DB in mount mode
Before starting the Standby DB in recovery mode, you need to replace the control file obtained from the Primary DB with the standby DB control file.
$ 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 Start Standby DB in recovery mode
$ 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. Start Primary CM & DB
15.1 Start Primary CM
To use VIP, start CM as the root account. (If you do not use VIP, you can skip this step.)
$ su - tibero $ tbcm -d CM DOWN SUCCESS! $ su - $ cd ~tibero or cd /home/tibero (navigate to $TB_HOME path) $ . .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 Start 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. Verify TSC synchronization
Check by querying the test table on the 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.
Check TSC status
1.1 Check connection status with Observer
You can check the connection status of PRIMARY and STANDBY on the Observer CM.
$ 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 Verify Primary DB connection
You can check by querying the v$standby_dest table on the Primary DB.
$ 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 Check VIP status
In the TSC configuration, the VIP runs only on the active server.
- If the Primary node is up, the Standby node is down
- In failover, the Standby node changes to up state
$ 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 modes
There are two observer modes: PROTECTIVE and DISASTER_PLAN. By default, PROTECTIVE mode is applied when the CM starts. To use DISASTER_PLAN mode, you must manually change it each time the observer restarts.
| Type | Description |
|---|---|
| PROTECTIVE | Failover occurs when a problem happens with the Primary DB (when DB shuts down) |
| DISASTER_PLAN | Failover occurs when there is an issue with the Primary cluster (when CM or DB shuts down abnormally) |
Change Observer mode
Perform the following to change the mode.
$ 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 Start and Shutdown
1. Startup procedure
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 or cd /home/tibero (navigate to $TB_HOME path) $ . .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 or cd /home/tibero (navigate to $TB_HOME path) $ . .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. Shutdown procedure
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).