GBase 8s灾备集群HAC (四) 异地灾备RSS
目錄
1.概述
2.安裝
3.配置環(huán)境
4.連接主庫
5.功能測試:
6.可能出現(xiàn)的異常error:
1.概述
前面提到的HAC主備也叫同城備份
為了保證主備雙庫的數(shù)據(jù)一致性,HAC的主庫備庫一般都很近,為了防止出現(xiàn)大型災(zāi)難導(dǎo)致主備雙庫同時宕機導(dǎo)致數(shù)據(jù)丟失,GBase8s提供了異地災(zāi)備(RSS)
可以將同城災(zāi)備和異地災(zāi)備結(jié)合起來構(gòu)建一套兩地三中心的災(zāi)備方案
兩地指的是HAC主備庫的同城所在地,RSS異地災(zāi)備庫的所在地
三中心之的是主庫中心,同城備庫中心,RSS異地災(zāi)備中心
2.安裝
需要先配置在兩個新節(jié)點安裝GBase8s,具體步驟可以參考:
GBase 8s v8.8數(shù)據(jù)庫的安裝(安裝準(zhǔn)備)_Kael Z的博客-CSDN博客
GBase 8s v8.8數(shù)據(jù)庫的安裝_Kael Z的博客-CSDN博客
3.配置環(huán)境
配置環(huán)境之前需要先對數(shù)據(jù)庫進行實例化,可以參考前面hac的實例化:
GBase 8s災(zāi)備集群HAC (二) 環(huán)境準(zhǔn)備_Kael Z的博客-CSDN博客
需要注意的是實例名需要根據(jù)自己的需要命名成不同的,IP地址也要根據(jù)當(dāng)前的節(jié)點IP進行
例如HAC1:192.168.200.191節(jié)點實例名為gbaseserver_hac1,HAC2:192.168.200.192節(jié)點實例名為gbaseserver_hac2。
分別在主庫,備庫,異地災(zāi)備的這4個節(jié)點的/home/gbasedbt/.rhosts分別重新編輯成:
192.168.200.180 gbasedbt 192.168.200.190 gbasedbt 192.168.200.191 gbasedbt 192.168.200.192 gbasedbt分別在主庫,備庫,異地災(zāi)備的這4個節(jié)點的/opt/gbase/etc/sqlhosts.*分別進行編輯:
gbaseserver onsoctcp 192.168.58.100 9088 gbaseserver_hac onsoctcp 192.168.58.110 9088 gbaseserver_hac1 onsoctcp 192.168.58.111 9088 gbaseserver_hac2 onsoctcp 192.168.58.112 9088編輯onconfig.gbaseserver_hac1中的SERVERNUM,DBSERVERNAME,LOG_INDEX_BUILDS,
其中需要將4個節(jié)點的參數(shù):LOG_INDEX_BUILDS均設(shè)置為1
vim /opt/gbase/etc/onconfig.gbaseserver_hac1 SERVERNUM 11 DBSERVERNAME gbaseserver_hac1 LOG_INDEX_BUILDS 14.連接主庫
在主庫執(zhí)行命令onmode -d add RSS gbaseserver_hac1連接RSS節(jié)點1:
onmode -d add RSS gbaseserver_hac1如果沒報錯繼續(xù)在主庫執(zhí)行:
ontape -s -L 0 -t STDIO | ssh 192.168.200.191 "source /home/gbasedbt/profile.gbaseserver_hac1 && ontape -p -t STDIO "如果沒報錯可以去異地備庫使用onstat -查看狀態(tài)變成Fast Recovery說明成功
[gbasedbt@localhost ~]$ onstat - Your evaluation license will expire on 2023-08-23 00:00:00 Fast Recovery -- Up 00:00:51 -- 597864 Kbytes在異地備庫執(zhí)行命令onmode -d RSS gbaseserver連接主庫:
onmode -d RSS gbaseserver分別在主庫和異地備庫執(zhí)行onstat -g rss verbose查看狀態(tài):
主庫執(zhí)行onstat -g rss verbose狀態(tài)變成On-Line (Prim):
[gbasedbt@localhost ~]$ onstat -g rss verbose Your evaluation license will expire on 2023-08-18 00:00:00 On-Line (Prim) -- Up 5 days 01:21:40 -- 597864 KbytesLocal server type: Primary Index page logging status: Enabled Index page logging was enabled at: 2022/08/23 11:27:48 Number of RSS servers: 2RSS Server information:RSS Server control block: 0x49c6a170 RSS server name: gbaseserver_hac1 RSS server status: Active RSS connection status: Connected RSS flow control:6144/5632 Log transmission status: Active Next log page to send(log id,page): 5,2349 Last log page acked(log id,page): 5,2348 Last log page applied(log id,page): 5,2348 Time of Last Acknowledgement: 2022-08-23.16:48:56 Pending Log Pages to be ACKed: 0 Approximate Log Page Backlog:0 Sequence number of next buffer to send: 122 Sequence number of last buffer acked: 121 Supports Proxy Writes: NRSS Server control block: 0x4a455e40 RSS server name: gbaseserver_hac2 RSS server status: Active RSS connection status: Connected RSS flow control:6144/5632 Log transmission status: Active Next log page to send(log id,page): 5,2349 Last log page acked(log id,page): 5,2348 Last log page applied(log id,page): 5,2348 Time of Last Acknowledgement: 2022-08-23.16:49:00 Pending Log Pages to be ACKed: 0 Approximate Log Page Backlog:0 Sequence number of next buffer to send: 75 Sequence number of last buffer acked: 74 Supports Proxy Writes: N兩個異地備庫分別執(zhí)行備庫為onstat -g rss verbose狀態(tài)都變成Read-Only (RSS)說明成功:
[gbasedbt@localhost ~]$ onstat -g rss verbose Your evaluation license will expire on 2023-08-23 00:00:00 Read-Only (RSS) -- Up 00:01:49 -- 1135464 KbytesRSS Server control block: 0x47fd9e60 Local server type: RSS Server Status : Active Source server name: gbaseserver Connection status: Connected Last log page received(log id,page): 5,2348 Sequence number of last buffer received: 74 Sequence number of last buffer acked: 74 Delay Apply: Not configured. Stop Apply: Not configured. Delay or Stop Apply not active.5.功能測試:
在主庫中創(chuàng)建數(shù)據(jù)庫和表,并且插入數(shù)據(jù):
[gbasedbt@localhost ~]$ dbaccess - - Your evaluation license will expire on 2023-08-18 00:00:00 > create database kael with log;Database created.> database kael;Database closed.Database selected.> create table kael_t (id int);Table created.> insert into kael_t values(1);1 row(s) inserted.> select * from kael_t;id 11 row(s) retrieved.> Database closed.分別在同城備庫:gbaseserver_hac,異地RSS備庫:gbaseserver_hac1,gbaseserver_hac2查看結(jié)果數(shù)據(jù)庫,表以及插入的數(shù)據(jù)均已同步:
[gbasedbt@localhost etc]$ dbaccess - - Your evaluation license will expire on 2023-08-18 00:00:00 > database kael;Database selected.> select * from kael_t;id 11 row(s) retrieved.> Database closed.6.可能出現(xiàn)的異常error:
如果主庫已經(jīng)使用oninit -ivwy啟動了,修改的onconfig.gbaseserver參數(shù)不能立即生效,如果不想重啟數(shù)據(jù)庫可以通過onmode -wf命令進行修改:
[gbasedbt@localhost etc]$ onmode -wf LOG_INDEX_BUILDS=1 Your evaluation license will expire on 2023-08-18 00:00:00 Value of LOG_INDEX_BUILDS has been changed to 1.總結(jié)
以上是生活随笔為你收集整理的GBase 8s灾备集群HAC (四) 异地灾备RSS的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 扫盲贴-汽车上坡辅助HAC和自动驻车Au
- 下一篇: MIT麻省理工最新研究揭示GAN生成数据