GBase 8s
安装配置
问答

关于GBase的双机HAC配置不成功的问题

发表于2025-11-04 14:10:1981次浏览4个评论

【GBase版本】:

GBase8sV8.8_TL_3.6.3_3X2_1_783c8d_RHEL6_x86_64

【操作系统】:

Kylin-Server-V10-SP3-2403-Release-20240426-X86_64 (银河麒麟服务器高级版本V10)

【CPU】:

虚拟机CPU (x64 2核2线程)

【问题描述】*:

我是按教程 安装和配置 | GBASE南大通用 来操作的。我的节点信息如下:
primary 172.16.30.213 9088

secondary 172.16.30.214 9088

我只验证同城双机,所以只准备了这两个节点。

 

先是primary的相关配置如下

其中primary的相关配置如下:

/home/gbasedbt/profile.gbaseserver:

[ -f ~/.bashrc ] && . ~/.bashrc
export GBASEDBTSERVER=gbaseserver
export GBASEDBTDIR=/opt/GBASE/gbase
export ONCONFIG=onconfig.gbaseserver
export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/sqlhosts.gbaseserver
export PATH=$GBASEDBTDIR/bin:$GBASEDBTDIR/sbin:/usr/bin:${PATH}:.
export GL_DATE="%iY-%m-%d"  
export DATETIME="%iY-%m-%d %H:%M:%S"  
export DB_LOCALE=zh_cn.GB18030-2000  
export CLIENT_LOCALE=zh_cn.GB18030-2000  
export LD_LIBRARY_PATH=${GBASEDBTDIR}/lib:${GBASEDBTDIR}/lib/esql:${GBASEDBTDIR}/lib/cli  
export TERM=vt100  
export TERMCAP=$GBASEDBTDIR/etc/termcap  
export GBASEDBTTERM=termcap  
export DBTEMP=$GBASEDBTDIR/tmp

/opt/GBASE/gbase/etc/sqlhosts.gbaseserver:

#**************************************************************************
#
#  Licensed Material - Property Of GBASE
#
#  "Restricted Materials of GBASE"
#
#  GBase
#  Copyright General Data Corp. 2014, 2015
#
#  Title:       sqlhosts.demo
#  Description: Default sqlhosts file for running demos.
#
#**************************************************************************
# The connectivity information for each database server includes four fields
# of required information and one optional field. You can also configure
# database server groups.
#
# The format for the five fields of connectivity information for a database
# server is one line in the UNIX  sqlhosts file, as follows:
#

#
# dbservername is the name of a database server on the network.
#
# nettype is an 8-character string specifying the protocol in this format:
#
# ddiiippp
#
# where
#   dd  =  Database product [|ol|on|dr]
#   iii =  Interface type [ipc|soc|tli|sql]
#   ppp =  Protocol [imc|nmp|shm|spx|str|tcp|ssl|mux]
#
# hostname is the name of the computer where the database server resides.
#
# servicename is a service name entry from the services file.
#
# options in the fifth field:
#
#   b=
#   c=
#   g=
#   i=
#   e=
#   m=
#   k=
#   r=
#   s=
#   csm=
#   cfd=
#
# To create an entry for a group, put a group name in the dbservername field,
# the word group in the nettype field, a hyphen in both the hostname and the
# servicename fileds, and i= in the options field.
#
# For additional information on the parameters, see the GBase
# Administrator's Guide.
#**************************************************************************
# IANA (www.iana.org) assigned port number/service names for GBase:
# sqlexec 9088/tcp
# sqlexec-ssl 9089/tcp

demo_on onipcshm        on_hostname     on_servername
gbaseserver onsoctcp 172.16.30.213 9088
gbaseserver_hac onsoctcp 172.16.30.214 9088

/opt/GBASE/gbase/etc/onconfig.gbaseserver(由于内容过多,我只粘贴修改了的部分)

ROOTNAME rootdbs
ROOTPATH $GBASEDBTDIR/gbaseserver_dbs/rootdbs
ROOTSIZE 300000
PHYSFILE 50000
MSGPATH $GBASEDBTDIR/tmp/gbaseserver.log
DBSPACETEMP dbspacetemp
SBSPACETEMP sbspacetemp
SBSPACENAME sbspace
SERVERNUM 1
DBSERVERNAME gbaseserver
DRAUTO                  3

 

/home/gbasedbt/.rhosts:

172.16.30.213 gbasedbt
172.16.30.214 gbasedbt

系统其他配置如文档描述那样配置的

 

然后是secondary的相关配置如下

/home/gbasedbt/profile.gbaseserver_hac:

export GBASEDBTSERVER=gbaseserver_hac
export GBASEDBTDIR=/opt/GBASE/gbase
export ONCONFIG=onconfig.gbaseserver_hac
export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/sqlhosts.gbaseserver_hac
export PATH=$GBASEDBTDIR/bin:$GBASEDBTDIR/sbin:/usr/bin:${PATH}:.
export GL_DATE="%iY-%m-%d"  
export DATETIME="%iY-%m-%d %H:%M:%S"  
export DB_LOCALE=zh_cn.GB18030-2000  
export CLIENT_LOCALE=zh_cn.GB18030-2000  
export LD_LIBRARY_PATH=${GBASEDBTDIR}/lib:${GBASEDBTDIR}/lib/esql:${GBASEDBTDIR}/lib/cli  
export TERM=vt100  
export TERMCAP=$GBASEDBTDIR/etc/termcap  
export GBASEDBTTERM=termcap  
export DBTEMP=$GBASEDBTDIR/tmp

/opt/GBASE/gbase/etc/sqlhosts.gbaseserver_hac:

#**************************************************************************
#
#  Licensed Material - Property Of GBASE
#
#  "Restricted Materials of GBASE"
#
#  GBase
#  Copyright General Data Corp. 2014, 2015
#
#  Title:       sqlhosts.demo
#  Description: Default sqlhosts file for running demos.
#
#**************************************************************************
# The connectivity information for each database server includes four fields
# of required information and one optional field. You can also configure
# database server groups.
#
# The format for the five fields of connectivity information for a database
# server is one line in the UNIX  sqlhosts file, as follows:
#

#
# dbservername is the name of a database server on the network.
#
# nettype is an 8-character string specifying the protocol in this format:
#
# ddiiippp
#
# where
#   dd  =  Database product [|ol|on|dr]
#   iii =  Interface type [ipc|soc|tli|sql]
#   ppp =  Protocol [imc|nmp|shm|spx|str|tcp|ssl|mux]
#
# hostname is the name of the computer where the database server resides.
#
# servicename is a service name entry from the services file.
#
# options in the fifth field:
#
#   b=
#   c=
#   g=
#   i=
#   e=
#   m=
#   k=
#   r=
#   s=
#   csm=
#   cfd=
#
# To create an entry for a group, put a group name in the dbservername field,
# the word group in the nettype field, a hyphen in both the hostname and the
# servicename fileds, and i= in the options field.
#
# For additional information on the parameters, see the GBase
# Administrator's Guide.
#**************************************************************************
# IANA (www.iana.org) assigned port number/service names for GBase:
# sqlexec 9088/tcp
# sqlexec-ssl 9089/tcp

demo_on onipcshM        on_hostname     on_servername
gbaseserver onsoctcp 172.16.30.213 9088
gbaseserver_hac onsoctcp 172.16.30.214 9088

/opt/GBASE/gbase/etc/onconfig.gbaseserver_hac

ROOTNAME rootdbs
ROOTPATH $GBASEDBTDIR/gbaseserver_dbs/rootdbs
ROOTOFFSET 0
ROOTSIZE 300000
PHYSFILE 50000
MSGPATH $GBASEDBTDIR/tmp/gbaseserver.log
DBSPACETEMP dbspacetemp 
SBSPACETEMP sbspacetemp
SBSPACENAME sbspace
SERVERNUM 10
DBSERVERNAME gbaseserver_hac
DRAUTO                  3

/home/gbasedbt/.rhosts:

172.16.30.213 gbasedbt
172.16.30.214 gbasedbt

服务器其他配置和primary保持一致。

 

我在172.16.30.213(primary)上执行 oninit -ivwy得到如下结果:
Your evaluation license will expire on 2026-11-03 00:00:00
Reading configuration file '/opt/GBASE/gbase/etc/onconfig.gbaseserver'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 4310 kbytes...succeeded
Creating infos file "/opt/GBASE/gbase/etc/.infos.gbaseserver"...succeeded
Linking conf file "/opt/GBASE/gbase/etc/.conf.gbaseserver"...succeeded
Initializing rhead structure...rhlock_t 16384 (512K)... rlock_t (2656K)... Writing to infos file...succeeded
Initialization of Encryption...succeeded
Initializing ASF...succeeded
Initializing Dictionary Cache and SPL Routine Cache...succeeded
Bringing up ADM VP...succeeded
Creating VP classes...succeeded
Forking main_loop thread...succeeded
Initializing DR structures...succeeded
Forking 1 'soctcp' listener threads...succeeded
Starting tracing...succeeded
Initializing 8 flushers...succeeded
Initializing SDS Server network connections...succeeded
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Validating chunks...succeeded
Initialize Async Log Flusher...succeeded
Starting B-tree Scanner...succeeded
Init ReadAhead Daemon...succeeded
Init DB Util Daemon...succeeded
Initializing DBSPACETEMP list...succeeded
Init Auto Tuning Daemon...succeeded
Checking database partition index...succeeded
Initializing dataskip structure...succeeded
Checking for temporary tables to drop...succeeded
Updating Global Row Counter...succeeded
Forking onmode_mon thread...succeeded
Creating periodic thread...succeeded
Creating periodic thread...succeeded
Starting scheduling system...succeeded
Verbose output complete: mode = 5

查看onstat -g dri得到如下结果:
Your evaluation license will expire on 2026-11-03 00:00:00
On-Line (Prim) -- Up 00:15:09 -- 156976 Kbytes
Blocked:LAST_LOG_RESERVED4BACKUP

Data Replication at 0x45fe5028: 
 Type           State        Paired server        Last DR CKPT (id/pg)    Supports Proxy Writes   
 primary        off          gbaseserver_hac              -1 / -1         NA

 DRINTERVAL   0 
 DRTIMEOUT    30 
 DRAUTO       3 
 DRLOSTFOUND  /opt/GBASE/gbase/etc/dr.lostfound 
 DRIDXAUTO    0 
 ENCRYPT_HDR  0 
 Backlog      0 
 Nothing Sent  
 Nothing Received  
 No Pings      
 Last log page applied(log id,page): 0,0

 

然后再去172.16.30.214(secondary)上执行:

[gbasedbt@localhost gbase]$ ontape -s -L 0 -t STDIO | ssh 172.16.30.214 "source /home/gbasedbt/profile.gbaseserver_hac && ontape -p -t STDIO "
Your evaluation license will expire on 2026-11-03 00:00:00
Shared memory not initialized for GBASEDBTSERVER 'gbaseserver_hac'.

Authorized users only. All activities may be monitored and reported.
gbasedbt@172.16.30.214's password: 
Your evaluation license will expire on 2026-11-03 00:00:00
Physical restore failed - function read archive backup failed code -1 errno 0

我都不知道备机上失败的原因是什么,因为tmp/gbaseserver.log里都没有记录日志。使用onstat -m也没有对应的日志。

我不确定教程上面提到的确保可正常启动数据库服务但是不需要启动数据库服务”怎么check,“主节点进行0级全备”应该要做什么操作。这些概念对于刚接触GBase 8s的人还不了解。

请问我的双机安装配置是哪里出了问题,我应该在哪里能看到错误日志。是否有能做技术沟通的即时渠道,我们后续会持续使用该库以应对信创,所以有迫切的想要掌握该库的基本使用的愿望。

评论

登录后才可以发表评论
用户头像
路路路发表于 9个月前
稍等
用户头像
小鱼不吐泡泡发表于 9个月前
这个报错应该是互信没配置好,这都还输入密码校验用户呢。
如果是有项目上后续会用的话,建议还是联系上项目销售,去申请专门的技术支持支撑,安装个测试环境之类的,手册上只是一个简单的教程,实际上这么装上去之后项目里后续使用还是会存在数据空间不足等问题。
如果单纯只是先学习的话,需要先把单机的手动安装步骤先学好,理解调的这些参数都是什么意思,怎么去调整配置,再安装备机,因为安装的时候备机就是一个主机的镜像,完全还原主机,有难度
用户头像
liaosnet发表于 9个月前
Blocked:LAST_LOG_RESERVED4BACKUP

主节点状态都不对了,继续不下去。。
执行onmode -wf LTAPEDEV=/dev/null 暂时不进行逻辑日志备份吧。该参数需要备机同时改。
冰凤发表于 9个月前
感觉是不是排查下主机之间的互信问题