GBase 8s
安装配置
问答

麒麟V10 ARM架构下安装GBase 8s数据库实例失败,提示shared memory not initialized for GBASEDBTSERVER 'gbasedb'

发表于2025-03-18 17:35:11425次浏览19个评论

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

【GBase版本】:GBase8sV8.8_TL_3.5.1_3X2_7_ARM

【操作系统】:Kylin V10 SP1

【CPU】:

【问题描述】*: 数据库安装完成后,使用 gbasedbt 用户执行opt/GBASE/gbase/etc/ GBaseInit_gbasedbt.sh脚本,自
动创建并初始化实例失败,提示shared memory not initialized for GBASEDBTSERVER ‘gbasedb’。

评论

登录后才可以发表评论
用户头像
路路路发表于 1年前
稍等回复您
用户头像
路路路发表于 1年前
内存问题,查查内存,onstat -m 查看日志
GBase用户24262发表于 1年前
@路路路:好的谢谢,这是查询到的日志信息
用户头像
liaosnet发表于 1年前
初始化就失败了呀。。使用 bash GBaseinit_gbase.sh 开始初始化操作。
GBase用户24262发表于 1年前
@liaosnet:是的,sh GBaseinit_gbase.sh执行不了,用bash GBaseinit_gbase.sh可以执行,最后提示共享内存的问题,也是困扰了好久,尝试了很多办法没能解决,希望知道什么原因的能帮帮忙,谢谢大家啦
GBase用户15765发表于 1年前
@GBase用户24262:先onclean -ky 再 执行bash GBaseinit_gbase.sh试试
GBase用户24262发表于 1年前
@GBase用户15765:清理时是这样显示的,要继续执行吗?
gbasedbt@zbc-pc:~$ onclean -ky
Your evaluation license will expire on 2026-03-18 00:00:00
onclean: Cleaning up processes and resources for 'gbasedb'...
Unable to read the INFOS_SNUM record from the file /opt/GBASE/gbase/etc/.conf.gbasedb.
用户头像
liaosnet发表于 1年前
@GBase用户24262:看 /opt/GBASE/gbase/etc/online_gbasedb.log 中的内容。
GBase用户24262发表于 1年前
@liaosnet:因为尝试过好几次,我把近三次相关的日志给您看看:
Wed Mar 19 10:13:13 2025

03/19/25 10:13:13 Requested shared memory segment size rounded from 905507KB to 905508KB
03/19/25 10:13:13 Successfully added a bufferpool of page size 2K.

03/19/25 10:13:13 Requested shared memory segment size rounded from 6483944KB to 6483948KB
03/19/25 10:13:15 Successfully added a bufferpool of page size 16K.

03/19/25 10:13:15 Event alarms enabled. ALARMPROG = '/opt/GBASE/gbase/etc/alarmprogram.sh'
03/19/25 10:13:15 Booting Language from module <>
03/19/25 10:13:15 Loading Module
03/19/25 10:13:15 Booting Language from module <>
03/19/25 10:13:15 Loading Module
03/19/25 10:13:21 CCFLAGS2 value set to 0x200
03/19/25 10:13:21 SQL_FEAT_CTRL value set to 0x8008
03/19/25 10:13:21 SQL_DEF_CTRL value set to 0x4b0
03/19/25 10:13:21 DR: DRAUTO is 0 (Off)
03/19/25 10:13:21 DR: ENCRYPT_HDR is 0 (HDR encryption Disabled)
03/19/25 10:13:21 Event notification facility epoll enabled.
03/19/25 10:13:21 GBase Database Server Version 12.10.FC4G1TL Software Serial Number AAA#B000000
03/19/25 10:13:21 Your evaluation license will expire on 2026-03-18 00:00:00

03/19/25 10:13:23 WARNING: mt_aio_wait: errno == EINVAL
03/19/25 10:13:23 Assert Warning: I/O read chunk 1, pagenum 0, pagecnt 1 --> errno = 2
03/19/25 10:13:23 GBase Database Server Version 12.10.FC4G1TL
03/19/25 10:13:23 Who: Session(1, gbasedbt@zbc-pc, 0, 0x53c8a028)
Thread(7, main_loop(), 53c43028, 9)
File: rsbuff.c Line: 5724
03/19/25 10:13:23 Action: Please notify GBASE Techical Support.
03/19/25 10:13:23 stack trace for pid 74654 written to /opt/GBASE/gbase/tmp/af.3ef2843
03/19/25 10:13:23 See Also: /opt/GBASE/gbase/tmp/af.3ef2843
03/19/25 10:13:23 oninit: Fatal error in shared memory initialization

14:40:13 GBase Database Server Started.
14:40:13 Requested shared memory segment size rounded from 237736KB to 240984KB

Wed Mar 19 14:40:15 2025

03/19/25 14:40:15 Requested shared memory segment size rounded from 905507KB to 905508KB
03/19/25 14:40:15 Successfully added a bufferpool of page size 2K.

03/19/25 14:40:15 Requested shared memory segment size rounded from 6483944KB to 6483948KB
03/19/25 14:40:15 shmget: [ENOSPC][28]: key 5256480b: The server could not allocate shared memory because an operating system limit was reached
03/19/25 14:40:15 Performance Advisory: Unable to allocate memory for bufferpool 16K
03/19/25 14:40:15 Action: Please notify GBASE Techical Support.
14:46:19 GBase Database Server Started.
14:46:19 Requested shared memory segment size rounded from 237736KB to 240984KB

Wed Mar 19 14:46:21 2025

03/19/25 14:46:21 Requested shared memory segment size rounded from 905507KB to 905508KB
03/19/25 14:46:21 Successfully added a bufferpool of page size 2K.

03/19/25 14:46:21 Requested shared memory segment size rounded from 6483944KB to 6483948KB
03/19/25 14:46:21 shmget: [EEXIST][17]: key 52564804: shared memory already exists
03/19/25 14:46:21 Performance Advisory: Unable to allocate memory for bufferpool 16K
03/19/25 14:46:21 Action: Please notify GBASE Techical Support.
GBase用户15765发表于 1年前
把onstat -m 贴出来看下,得查看是什么导致无法启动数据库 (sqlhosts 或者系统内核参数都有可能导致数据库无法正常启动从而无法完成后续初始化动作)
GBase用户24262发表于 1年前
@GBase用户15765:Your evaluation license will expire on 2026-03-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbasedb'

Message Log File: /opt/GBASE/gbase/etc/online_gbasedb.log

03/19/25 14:40:15 Requested shared memory segment size rounded from 905507KB to 905508KB
03/19/25 14:40:15 Successfully added a bufferpool of page size 2K.

03/19/25 14:40:15 Requested shared memory segment size rounded from 6483944KB to 6483948KB
03/19/25 14:40:15 shmget: [ENOSPC][28]: key 5256480b: The server could not allocate shared memory because an operating system limit was reached
03/19/25 14:40:15 Performance Advisory: Unable to allocate memory for bufferpool 16K
03/19/25 14:40:15 Action: Please notify GBASE Techical Support.
14:46:19 GBase Database Server Started.
14:46:19 Requested shared memory segment size rounded from 237736KB to 240984KB

Wed Mar 19 14:46:21 2025

03/19/25 14:46:21 Requested shared memory segment size rounded from 905507KB to 905508KB
03/19/25 14:46:21 Successfully added a bufferpool of page size 2K.

03/19/25 14:46:21 Requested shared memory segment size rounded from 6483944KB to 6483948KB
03/19/25 14:46:21 shmget: [EEXIST][17]: key 52564804: shared memory already exists
03/19/25 14:46:21 Performance Advisory: Unable to allocate memory for bufferpool 16K
03/19/25 14:46:21 Action: Please notify GBASE Techical Support.
用户头像
liaosnet发表于 1年前
@GBase用户24262:看最近的日志,03/19/25 14:40:15 shmget: [ENOSPC][28]: key 5256480b: The server could not allocate shared memory because an operating system limit was reached
这表示达到操作系统内存限制了,内核参数什么的没改吧。
GBase用户24262发表于 1年前
@liaosnet:因为之前报错shared memory not initialized for GBASEDBTSERVER 'gbasedb',所以自己做了很多尝试,大概修改了以下的一些参数配置
1》
kernel.shmmax
kernel.shmall
kernel.shmmni
2》
为 gbasedbt 用户设置无限制的 memlock
gbasedbt soft memlock unlimited
gbasedbt hard memlock unlimited
3》
sysctl -w vm.overcommit_memory=1 # 默认值为 0(保守分配)
sysctl -w vm.overcommit_ratio=80 # 默认值 50
最佳回答
GBase用户12345发表于 1年前
@GBase用户24262:改回原来的参数吧,把占用的内存段删除(执行ipcs -m查出来,执行ipcrm -M清除指定被占用的内存段)或者重启服务器应该就可以了
GBase用户24262发表于 1年前
@GBase用户12345:我改回了kernel.shmmax kernel.shmall kernel.shmmni相关参数,删除数据库并重启电脑重新安装,然后又回到原先所遇到过的问题。相关日志如下
gbasedbt@zbc-pc:~$ onstat -m
Your evaluation license will expire on 2026-03-20 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbasedb'

Message Log File: /opt/GBASE/gbase/etc/online_gbasedb.log
03/20/25 10:56:36 Your evaluation license will expire on 2026-03-20 00:00:00

03/20/25 10:56:38 WARNING: mt_aio_wait: errno == EINVAL
03/20/25 10:56:38 Assert Warning: chunk failed sanity check

03/20/25 10:56:38 GBase Database Server Version 12.10.FC4G1TL
03/20/25 10:56:38 Who: Session(1, gbasedbt@zbc-pc, 0, 0x53c8a028)
Thread(7, main_loop(), 53c43028, 10)
File: rspartn.c Line: 10776
03/20/25 10:56:38 Results: Chunk 1 is being taken OFFLINE.
03/20/25 10:56:38 Action: For all spaces other than temporary dbspaces, restore the space
containing the chunk from the archive. If this chunk belongs to a
temporary dbspace and if it is not the only chunk in that dbspace,
then drop and re-create the chunk. Otherwise drop and re-create
the temporary dbspace.
03/20/25 10:56:38 stack trace for pid 81877 written to /opt/GBASE/gbase/tmp/af.3ef83e6
03/20/25 10:56:38 See Also: /opt/GBASE/gbase/tmp/af.3ef83e6
03/20/25 10:56:39 I/O error, Primary Chunk '/opt/GBASE/gbase/gbasedb_dbs/rootdbs' -- Offline (sanity)
03/20/25 10:56:39 oninit: Fatal error in shared memory initialization

gbasedbt@zbc-pc:~$ ipcs -m

------------ 共享内存段 --------------
键 shmid 拥有者 权限 字节 连接数 状态
0x00000111 8 zbc 666 12 0
0x00000000 40 zbc 606 9210240 2 目标
0x00000000 41 zbc 606 9210240 2 目标
0x00000000 45 zbc 600 524288 2 目标
GBase用户12345发表于 1年前
@GBase用户24262:删除$GBASEDBTDIR/tmp路径下的af文件
修改$GBASEDBTDIR/etc/onconfig配置文件中的参数FULL_DISK_INIT 为1
重新执行 oninit- -ivwy
GBase用户24262发表于 1年前
@GBase用户12345:安照您说的操作了,修改的是onconfig.gbasedb配置文件,这是相关日志信息
gbasedbt@zbc-pc:~$ oninit -ivwy
Your evaluation license will expire on 2026-03-20 00:00:00
Reading configuration file '/opt/GBASE/gbase/etc/onconfig.gbasedb'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 237738 kbytes...succeeded
Creating infos file "/opt/GBASE/gbase/etc/.infos.gbasedb"...succeeded
Linking conf file "/opt/GBASE/gbase/etc/.conf.gbasedb"...succeeded
Initializing rhead structure...rhlock_t 131072 (4096K)... rlock_t (225781K)... 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 32 flushers...succeeded
oninit: Fatal error in shared memory initialization

WARNING: server initialization failed or timed out.
Check the message log, online.log, for errors.
gbasedbt@zbc-pc:~$ onstat -m
Your evaluation license will expire on 2026-03-20 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbasedb'

Message Log File: /opt/GBASE/gbase/etc/online_gbasedb.log
03/20/25 16:59:56 SQL_FEAT_CTRL value set to 0x8008
03/20/25 16:59:56 SQL_DEF_CTRL value set to 0x4b0
03/20/25 16:59:56 Waiting 600 seconds for startup to complete.
03/20/25 16:59:56 GBase Database Server Version 12.10.FC4G1TL Software Serial Number AAA#B000000
03/20/25 16:59:56 Your evaluation license will expire on 2026-03-20 00:00:00

03/20/25 16:59:56 WARNING: mt_aio_wait: errno == EINVAL
03/20/25 16:59:56 Assert Warning: I/O read chunk 1, pagenum 0, pagecnt 1 --> errno = 2
03/20/25 16:59:56 GBase Database Server Version 12.10.FC4G1TL
03/20/25 16:59:56 Who: Session(1, gbasedbt@zbc-pc, 0, 0x53c8a028)
Thread(7, main_loop(), 53c43028, 9)
File: rsbuff.c Line: 5724
03/20/25 16:59:56 Action: Please notify GBASE Techical Support.
03/20/25 16:59:56 stack trace for pid 73523 written to /opt/GBASE/gbase/tmp/af.3efd90c
03/20/25 16:59:56 See Also: /opt/GBASE/gbase/tmp/af.3efd90c
03/20/25 16:59:56 oninit: Fatal error in shared memory initialization

03/20/25 16:59:56 GBase Database Server Stopped.

16:59:56 mt_shm_remove: WARNING: may not have removed all/correct segments
新疆油腻大叔发表于 2个月前
不清楚啊。
崔哥发表于 2个月前
鼎湖当日弃人间,破敌收京下玉关。恸哭六军俱缟素,冲冠一怒为红颜。红颜流落非吾恋,逆贼天亡自荒宴。电扫黄巾定黑山,哭罢君亲再相见。相见初经田窦家,侯门歌舞出如花。许将戚里箜篌伎,等取将军油壁车。家本姑苏浣花里,圆圆小字娇罗绮。梦向夫差苑里游,宫娥拥入君王起。前身合是采莲人,门前一片横塘水。横塘双桨去如飞,何处豪家强载归。此际岂知非薄命,此时唯有泪沾衣。薰天意气连宫掖,明眸皓齿无人惜。夺归永巷闭良家,教就新声倾坐客。坐客飞觞红日暮,一曲哀弦向谁诉?白晳通侯最少年,拣取花枝屡回顾。早携娇鸟出樊笼,待得银河几时渡?恨杀军书抵死催,苦留后约将人误。相约恩深相见难,一朝蚁贼满长安。可怜思妇楼头柳,认作天边粉絮看。遍索绿珠围内第,强呼绛树出雕阑。若非壮士全师胜,争得蛾眉匹马还?蛾眉马上传呼进,云鬟不整惊魂定。蜡炬迎来在战场,啼妆满面残红印。专征萧鼓向秦川,金牛道上车千乘。斜谷云深起画楼,散关月落开妆镜。传来消息满江乡,乌桕红经十度霜。教曲伎师怜尚在,浣纱女伴忆同行。旧巢共是衔泥燕,飞上枝头变凤凰。长向尊前悲老大,有人夫婿擅侯王。当时只受声名累,贵戚名豪竞延致。一斛明珠万斛愁,关山漂泊腰肢细。错怨狂风飏落花,无边春色来天地。尝闻倾国与倾城,翻使周郎受重名。妻子岂应关大计,英雄无奈是多情。全家白骨成灰土,一代红妆照汗青。君不见,馆娃初起鸳鸯宿,越女如花看不足。香径尘生乌自啼,屧廊人去苔空绿。换羽移宫万里愁,珠歌翠舞古梁州。为君别唱吴宫曲,汉水东南日夜流!