暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

记一次GBase 8s 安装部署数据库初始化故障问题分析及处理记录

2489

一、前言

最近南大通用第十期GBase 8s 免费培训开始了,因为今年以来一直在进行去O的调研,看GBase 官网介绍 GBase 8s V8.8兼容Oracle,GBase 8s是在informix源码基础上改造的产品,学习GBase 8s刚好可以了解informix和测试迁移到Oracle。于是报名参加了本次的培训。

学习GBase 8s,首先要学会安装数据库软件,有一套属于自己的测试环境。我本次选择一台安装了Centos 7.9操作系统的64G内存的服务器。

但在安装时却遇到了一些所谓的异常情况,接下来我会介绍正常安装和遇到的一些问题。

二、安装部署

2.1 安装准备

按照GBase 官方文档,在按照GBase 8s前需创建一个gbasedbt用户,并按照要求安装了相应依赖包。从官网下载GBase8sV8.8_TL_3.5.0_arm.7z安装包并解压,前期准备工作本部分略,详细可参照官网文档 【https://cdn.gbase.cn//products/27/2n18SB0xuOY4JPwjr0WQa-GBase%208s%20V8.8%20%E5%AE%89%E8%A3%85%E6%89%8B%E5%86%8C.pdf (GBase 8s V8.8 安装手册.pdf)】

2.2 安装部署

本次选择定制安装模式,使用root用户,执行GBase 8s软件解压后的ids_install。

[root@host19c-node1 install]# sh ids_install -- 一路回车 Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... Launching installer... =============================================================================== GBase Software Bundle (created with InstallAnywhere) ------------------------------------------------------------------------------- Preparing CONSOLE Mode Installation... =============================================================================== Getting Started --------------- This application will guide you through the installation of GBase Software Bundle. Copyright General Data Corporation 2014, 2023. All rights reserved. 1. Release Notes The Release Notes can be found in /root/setup/install/doc/ids_unix_relnotes_12.10.html. 2. Launch Information Center Access the GBase Information Center at http://www.gbase.cn. To Begin Installation, respond to each prompt to proceed to the next step in the installation. If you want to change something on a previous step, type 'back'. You may cancel this installation at any time by typing 'quit'. PRESS <ENTER> TO CONTINUE: =============================================================================== License Agreement ----------------- Installation and Use of GBase Software Bundle Requires Acceptance of the Following License Agreement: Thank you for choosing GBase product! Please read carefully the following licencing agreement before installing any product: TIANJIN GENERAL DATA TECHNOLOGY CO. LTD. LICENSE AGREEMENT READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSETERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWAREMEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND. 1. LICENSE TO USE. GeneralData grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by GeneralData(collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid. 2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software PRESS <ENTER> TO CONTINUE: and all associated intellectual property rights is retained by GeneralData and/or its licensors. Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. GeneralData disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of GeneralData or its licensors is granted under this Agreement. 3. DISCLAIMER OF WARRANTY. Unless specified in this agreement, all express of implied conditions, representations and warranties, including any implied warranty of merchantability, fitness for aparticular purpose or non-infringement are disclaimed, except to theextent that these disclaimers are held to be legally invalid. 4. LIMITATION OF LIABILITY. To the extent not prohibited by law, in no event will GeneralData or its licensors be liable for any lost revenue, profit or data, or for special, indirect, consequential, incidental orpunitive damages, however caused regardless of the theory of liability, arising out of or related to the use of or inability to use software, even if GeneralData has PRESS <ENTER> TO CONTINUE: been advised of the possibility of such damages. In no event will GeneralData's libility to you, whether incontract, tort(including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of itsessential purpose. 5. TERMINATION. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without noticefrom GeneralData if you fail to comply with any provision of this Agreement. Upon Termination, you must destroy all copies of Software. 6. EXPORT REGULATIONS. All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export, re-export, or import as may be required after delivery to you. 7. CHINESE GOVERNMENT RESTRICTED. If Software is being acquired by or on behalf PRESS <ENTER> TO CONTINUE: of the Chinese Government, then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement. 8. GOVERNING LAW. Any action related to this Agreement will be governed by Chinese law: "COPYRIGHT LAW OF THE PEOPLE'S REPUBLIC OF CHINA", "PATENT LAW OF THE PEOPLE'S REPUBLIC OF CHINA", "TRADEMARK LAW OF THE PEOPLE'S REPUBLIC OF CHINA", "COMPUTER SOFTWARE PROTECTION REGULATIONS OF THE PEOPLE'S REPUBLIC OF CHINA". No choice of law rules of any jurisdiction will apply." 9. SEVERABILITY. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. 10. INTEGRATION. This Agreement is the entire agreement between you and GeneralData relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorize depresentative of each party. When the translation document has the different PRESS <ENTER> TO CONTINUE: meaning or has the conflicting views with Chinese original text conflict, should take the laws and regulations promulgation unit as well as the GeneralData issue Chinese original text as the standard. All trademarks and registered trademarks mentioned herein are the property of their respective owners. DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y =============================================================================== Installation Location --------------------- Choose location for software installation. Default Install Folder: /opt/GBASE/gbase ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT : /opt/gbase ---设置gbase8s软件安装目录,这里我设置的是 /opt/gbase INSTALL FOLDER IS: /opt/gbase IS THIS CORRECT? (Y/N): Y -- 输入Y =============================================================================== Installation or Distribution ---------------------------- Select the installation type. Typical: Install the database server with all features and a database server that is configured with default values. Includes: ** Client Software Development Kit (CSDK) ** Java Database Connectivity (JDBC) Minimum disk space required: 700-800MB Custom: Install the database server with specific features and software that you need. Optionally install a configured database server instance. Minimum disk space required: 75 MB (without a server instance) ->1- Typical installation 2- Custom installation 3- Extract the product files (-DLEGACY option) 4- Create a RPM package for redistribution ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 2 -- 选择2,自定义安装 =============================================================================== "Choose Install Features" Help ------------------------------ On the next screen, type the number of a feature to change whether it is selected or deselected. You can provide a list of numbers, separated by commas, with no leading or trailing spaces. For example, assume that the screen contains this list: 1- [X] ABC 2- [ ] XYZ Please choose the Features to be installed by this installer.: ___ If you want to install both ABC and XYZ, type: 2 If you want to install only XYZ, type: 1,2 PRESS <ENTER> TO CONTINUE: -- 按回车 =============================================================================== Choose Install Set ------------------ =============================================================================== Choose Product Features ----------------------- ENTER A COMMA_SEPARATED LIST OF NUMBERS REPRESENTING THE FEATURES YOU WOULD LIKE TO SELECT, OR DESELECT. TO VIEW A FEATURE'S DESCRIPTION, ENTER '?<NUMBER>'. PRESS <RETURN> WHEN YOU ARE DONE: 1- [X] GBase database server 2- |-[X] Base Server 3- |-[X] Extensions and tools 4- |-[X] J/Foundation 5- |-[X] Database extensions 6- |-[X] Conversion and reversion support 7- |-[X] XML publishing 8- |-[X] Demonstration database scripts 9- |-[X] Enterprise Replication 10- |-[X] Data loading utilities 11- |-[X] onunload and onload utilities 12- |-[X] dbload utility 13- |-[X] Backup and Restore 14- |-[X] archecker utility 15- |-[X] ON-Bar utility 16- |-[X] Interface to Tivoli Storage Manager 17- |-[X] Administrative utilities 18- |-[X] Performance monitoring utilities 19- |-[X] Miscellaneous monitoring utilities 20- |-[X] Auditing utilities 21- |-[X] Database import and export utilities 22- |-[X] JSON Client Support 23- [X] Global Language Support (GLS) 24- |-[X] Chinese Please choose the Features to be installed by this installer.: =============================================================================== Feature review -------------- Would you like to review the features that you have selected, or change which features you have selected? ->1- Continue 2- Return to feature tree ENTER THE NUMBER OF THE DESIRED CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT: -- 回车 =============================================================================== Get Role Separation choice -------------------------- Enable role separation for auditing procedures. If you enable role separation, you can assign existing groups of users to specific roles. If you do not enable role separation, the database server administrator performs all administration tasks. 1- Enable role separation ->2- Do not enable role separation ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: =============================================================================== Server Instance --------------- Type 'back' to go to the previous step or 'quit' to cancel the installation. Create a database server instance? 1- Yes - create a server instance ->2- No - do not create a server instance ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: --回车 =============================================================================== Installation Summary -------------------- Please review the following before continuing: Product Name: GBase Software Bundle Install Folder: /opt/gbase Product Features: GBase database server, Base Server, Extensions and tools, J/Foundation, Database extensions, Conversion and reversion support, XML publishing, Demonstration database scripts, Enterprise Replication, Data loading utilities, onunload and onload utilities, dbload utility, Backup and Restore, archecker utility, ON-Bar utility, Interface to Tivoli Storage Manager, Administrative utilities, Performance monitoring utilities, Miscellaneous monitoring utilities, Auditing utilities, Database import and export utilities, JSON Client Support, Global Language Support (GLS), Chinese Disk Space Information (for Installation Target): Required: 565,112,681 Bytes Available: 124,086,292,480 Bytes PRESS <ENTER> TO CONTINUE: -- 按回车 =============================================================================== Ready To Install ---------------- InstallAnywhere is now ready to install GBase Software Bundle onto your system at the following location: /opt/gbase PRESS <ENTER> TO INSTALL: =============================================================================== Installing... ------------- [==================|==================|==================|==================] [------------------|------------------|------------------|------------------] =============================================================================== Installation Complete --------------------- Congratulations! GBase Software Bundle installation is complete. Product install status: GBase: Successful GBase Connect: Successful GBase 8s V8.8 For more information about using GBase products, see the GBase Information Center at http://www.gbase.cn. PRESS <ENTER> TO EXIT THE INSTALLER: -- 按回车退出

2.3 初始化实例

切换到gbasedbt用户,进入/opt/gbase/etc目录,执行GBaseInit_gbasedbt.sh初始化脚本。

[root@host19c-node1 ~]# su - gbasedbt Last login: Thu Oct 19 10:21:01 CST 2023 on pts/6 [gbasedbt@host19c-node1 ~]$ cd /opt/gbase/etc [gbasedbt@host19c-node1 etc]$ sh GBaseInit_gbasedbt.sh Initializing Program...OK ENTER THE INSTANCE INFORMATION or PRESS <ENTER> TO ACCEPT THE DEFAULT. ENTER GBASE INSTANCE NAME (GBASEDBTSERVER) [Default:gbaseserver]: gbasedb SEARCHING FOR GBASE INSTALL FOLDER, PLEASE WAIT FOR SECONDS... GBASE INSTALL FOLDER LIST: 1) /opt/gbase CHOOSE GBASE INSTALL FOLDER(GBASEDBTDIR) [Default:/opt/gbase]: CHOOSE SERVICE IP ADDRESS FROM THE LIST: 1) 172.18.0.1 2) 172.17.0.1 3) 192.168.73.15 4) 10.90.0.25 5) 127.0.0.1 ENTER THE NUMBER FOR YOUR CHOICE [Default:172.18.0.1]: 3 -- 选择服务器IP SPECIFY THE PORT NUMBER FOR GBASE [Default:9088]: --默认采用9088端口 INITIALIZE TYPE: 1) TYPICAL -- Initialize the instance with all features configured with default values. 2) CUSTOM -- Initialize the instance with specific features that you need. ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 2 -- 选择 2,采用自定义方式 GBASE CHARACTER SET LIST: 1) en_US.8859-1 2) zh_CN.GB18030-2000 3) zh_CN.utf8 ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 3 ENTER THE DATA SPACE PATH [Default:/opt/gbase/gbasedb_dbs]: ENTER THE LOGICAL LOG DBSPACE SIZE(MB) [Default:10000]: ENTER THE PHYSICAL LOG DBSPACE SIZE(MB) [Default:10000]: ENTER THE SMART LOB DBSPACE SIZE(MB) [Default:2030]: ENTER THE TEMPORARY DBSPACE SIZE(MB) [Default:2030]: ENTER "Y" TO START DATABASE ADVANCED SETTINGS, OR ENTER "N" TO ACCEPT DEFAULT VALUES: [Default:N]: Y ENTER THE NUMBER OF DATA DBSPACES [Default:1]: ENTER THE NUMBER OF TEMP DBSPACES [Default:1]: Enter "Y" TO ENABLE ENVIRONMENT GL_USEGLU, OR ENTER "N" TO DISABLE: [Default:N]: Y INSTANCE SUMMARY: Instance name: gbasedb GBase install directory: /opt/gbase IP address & port: 192.168.73.15:9088 Character set: zh_CN.utf8 Logical log space size: 10000 MB Physical log space size: 10000 MB Smart LOB space size: 2030 MB Temp DBSpace size: 2030 MB Data path: /opt/gbase/gbasedb_dbs Data path free size: 118251 MB The number of data DBSpace: 1 The number of temp DBSpace: 1 Environment GL_USEGLU: 1 Enter "Y" to Start database initializing, or Enter "N" to Edit Again: Y -- 输入Y Touching Chunks...OK Create sqlhosts File: /opt/gbase/etc/sqlhosts.gbasedb ...OK Setting Parameters in /opt/gbase/etc/onconfig.gbasedb : ROOTPATH.ROOTSIZE.DBSERVERNAME.FULL_DISK_INIT.SBSPACENAME.SYSSBSPACENAME.DBSPACETEMP.LOGFILES.MULTIPROCESSOR.VPCLASS.NETTYPE.CLEANERS.DEF_TABLE_LOCKMODE.DIRECT_IO.LOCKS.TAPEDEV.LTAPEDEV.CKPTINTVL.DS_MAX_QUERIES.DS_TOTAL_MEMORY.DS_NONPDQ_QUERY_MEM.PHYSBUFF.LOGBUFF.AUTO_TUNE.MSGPATH.SERVERNUM.ALLOW_NEWLINE.TEMPTAB_NOLOG.DUMPSHMEM.USEOSTIME.STACKSIZE.ON_RECVRY_THREADS.OFF_RECVRY_THREADS.USELASTCOMMITTED.SHMVIRTSIZE.SHMADD.GBASEDBTCONTIME.BUFFERPOOL2K.BUFFERPOOL16K...AUTO_CKPTS.OK Initializing Root DBSpace & Share Memory...OK Creating system database..............OK Creating logical log Dbspace...OK Creating physical log Dbspace...OK Creating smart LOB Dbspace...OK Creating temp Dbspace.1...OK Creating data Dbspace.1...OK Setting dbscheduler...OK Moving physical log...OK Adding 40 logical logs: 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40...OK Setting data chunks extendable...OK Cleaning logical logs in rootdbs...Your evaluation license will expire on 2024-10-18 00:00:00 .Your evaluation license will expire on 2024-10-18 00:00:00 .Your evaluation license will expire on 2024-10-18 00:00:00 .Your evaluation license will expire on 2024-10-18 00:00:00 ...OK Database restarting.......Your evaluation license will expire on 2024-10-18 00:00:00 OK Creating database: gbasedb...OK Now you can use this URL to connect to gbasedb: jdbc:gbasedbt-sqli://192.168.73.15:9088/gbasedb:GBASEDBTSERVER=gbasedb;DB_LOCALE=zh_CN.utf8;CLIENT_LOCALE=zh_CN.utf8;NEWCODESET=UTF8,utf8,57372;GL_USEGLU=1 Version: Your evaluation license will expire on 2024-10-18 00:00:00 On-Line -- Up 00:00:44 -- 34674664 Kbytes Build Number: 3.5.0_3X2_4_e44ff2 GBase Initializing Finished! Initialize log file : ./InitGBaseDB_202310191023.log Press <ENTER> to Exit and Logout...

2.4 检查环境

按照上面安装初始化后,已经启动了gbase 8s数据库,使用ps -ef|grep oninit可以看到gbase 8s启动后启动的进程信息。使用dbaccess客户端工具可以连接gbase 8s数据库。

[root@host19c-node1 ~]# ps -ef|grep oninit gbasedbt 40975 1 30 10:35 ? 00:00:26 oninit -v root 41096 40975 0 10:36 ? 00:00:00 oninit -v root 41097 41096 0 10:36 ? 00:00:00 oninit -v root 41099 41096 0 10:36 ? 00:00:00 oninit -v root 41101 41096 0 10:36 ? 00:00:00 oninit -v root 41103 41096 0 10:36 ? 00:00:00 oninit -v root 41109 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41111 41096 1 10:36 ? 00:00:00 oninit -v gbasedbt 41112 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41113 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41115 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41116 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41117 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41118 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41120 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41121 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41122 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41123 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41124 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41125 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41126 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41127 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41128 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41130 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41131 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41132 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41133 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41160 41096 0 10:36 ? 00:00:00 oninit -v gbasedbt 41163 41096 0 10:36 ? 00:00:00 oninit -v root 41166 41096 0 10:36 ? 00:00:00 oninit -v root 41167 41096 0 10:36 ? 00:00:00 oninit -v root 41168 41096 0 10:36 ? 00:00:00 oninit -v root 41169 41096 0 10:36 ? 00:00:00 oninit -v root 41171 41096 0 10:36 ? 00:00:00 oninit -v root 41402 17571 0 10:37 pts/6 00:00:00 grep --color=auto oninit [gbasedbt@host19c-node1 ~]$ dbaccess Your evaluation license will expire on 2024-10-18 00:00:00 SELECT DATABASE >> Select a database with the Arrow Keys, or enter a name, then press Return. ----------------------- @gbasedb --------------- Press CTRL-W for Help -------- gbasedb@gbasedb gbasedbt@gbasedb sys@gbasedb sysadmin@gbasedb sysmaster@gbasedb sysuser@gbasedb sysutils@gbasedb

三、安装异常及解决办法

上面描述的是正常安装gbase 8s的相关信息,但我在另一套64G内存,Centos 7.9上安装GBase 8s时遇到了如下异常情况。

3.1 初始化失败

在执行数据库初始化时,耗时很长,最后提示shared memory not initialized初始化失败。

Touching Chunks...OK Create sqlhosts File: /opt/gbase/etc/sqlhosts.gbasedb ...OK Setting Parameters in /opt/gbase/etc/onconfig.gbasedb : ROOTPATH.ROOTSIZE.DBSERVERNAME.FULL_DISK_INIT.SBSPACENAME.SYSSBSPACENAME.DBSPACETEMP.LOGFILES.MULTIPROCESSOR.VPCLASS.NETTYPE.CLEANERS.DEF_TABLE_LOCKMODE.DIRECT_IO.LOCKS.TAPEDEV.LTAPEDEV.CKPTINTVL.DS_MAX_QUERIES.DS_TOTAL_MEMORY.DS_NONPDQK Initializing Root DBSpace & Share Memory...OK Creating system database..............................GBaseInit_gbasedbt.sh: line 955: [: !=: unary operator expected OK Creating logical log Dbspace...OK Creating physical log Dbspace...OK Creating smart LOB Dbspace...OK Creating temp Dbspace.1...OK Creating data Dbspace.1...OK Setting dbscheduler...OK Moving physical log...OK Adding 40 logical logs: 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40...OK Setting data chunks extendable...OK Cleaning logical logs in rootdbs...Your evaluation license will expire on 2024-10-18 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbasedb' .Your evaluation license will expire on 2024-10-18 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbasedb' .Your evaluation license will expire on 2024-10-18 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbasedb' .Your evaluation license will expire on 2024-10-18 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbasedb' OK Database restarting.......Your evaluation license will expire on 2024-10-18 00:00:00 Your evaluation license will expire on 2024-10-18 00:00:00 Initalize Failed,See Message Log File: /opt/gbase/etc/online_gbasedb.log For Details Creating database: gbasedb...OK Now you can use this URL to connect to gbasedb: jdbc:gbasedbt-sqli://10.110.7.41:9088/gbasedb:GBASEDBTSERVER=gbasedb;DB_LOCALE=zh_CN.utf8;CLIENT_LOCALE=zh_CN.utf8;NEWCODESET=UTF8,utf8,57372;GL_USEGLU=1 Version: Your evaluation license will expire on 2024-10-18 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbasedb' Build Number: 3.5.0_3X2_4_e44ff2 GBase Initializing Finished! Initialize log file : ./InitGBaseDB_202310191120.log Press <ENTER> to Exit and Logout... Killed

3.2 排查过程

执行onstat -m报如下信息

[gbasedbt@xsky-node3 ~]$ onstat -m [gbasedbt@xsky-node3 etc]$ onstat -m Your evaluation license will expire on 2024-10-17 00:00:00 shared memory not initialized for GBASEDBTSERVER 'xxxxx' Message Log File: /opt/gbase/etc/online_xxxx.log 10/18/23 16:18:37 Assert Warning: chunk failed sanity check 10/18/23 16:18:37 GBase Database Server Version 12.10.FC4G1TL 10/18/23 16:18:37 Who: Session(1, gbasedbt@xsky-node3, 0, 0x82448028) Thread(7, main_loop(), 82401028, 8) File: rspartn.c Line: 10776 10/18/23 16:18:37 Results: Chunk 1 is being taken OFFLINE. 10/18/23 16:18:37 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. 10/18/23 16:18:37 stack trace for pid 13981 written to /opt/gbase/tmp/af.3ef94dd 10/18/23 16:18:37 See Also: /opt/gbase/tmp/af.3ef94dd 10/18/23 16:18:37 chunk failed sanity check 10/18/23 16:18:38 I/O error, Primary Chunk '/opt/gbase/xxxxx_dbs/rootdbs' -- Offline (sanity) 10/18/23 16:18:38 oninit: Fatal error in shared memory initialization

执行onint -vy报如下错误

[gbasedbt@xsky-node3 etc]$ oninit -vy Your evaluation license will expire on 2024-10-18 00:00:00 Reading configuration file '/opt/gbase/etc/onconfig.gbasedb'...succeeded Creating /GBASEDBTTMP/.infxdirs...succeeded Allocating and attaching to shared memory...succeeded Creating resident pool 953930 kbytes...succeeded Creating infos file "/opt/gbase/etc/.infos.gbasedb"...succeeded Linking conf file "/opt/gbase/etc/.conf.gbasedb"...succeeded Initializing rhead structure...rhlock_t 524288 (16384K)... rlock_t (929687K)... 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.

3.3 处理过程

在执行oninit -vy时,发现在/opt/gbase/tmp/目录下生成了 af.3ef94dd和af.3ef94dd.xxx两个文件,查看了这两个文件内容,类似dump内存之类的信息。

在执行oninit -vy后,手工删除了/opt/gbase/tmp/下生成的af开头的两个文件,然后执行oninit -ivy

Your evaluation license will expire on 2024-10-17 00:00:00 Reading configuration file '/opt/gbase/etc/onconfig.silkinfo'...succeeded Creating /GBASEDBTTMP/.infxdirs...succeeded Allocating and attaching to shared memory...succeeded Creating resident pool 953930 kbytes...succeeded Creating infos file "/opt/gbase/etc/.infos.silkinfo"...succeeded Linking conf file "/opt/gbase/etc/.conf.silkinfo"...succeeded Initializing rhead structure...rhlock_t 524288 (16384K)... rlock_t (929687K)... 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 Initializing log/checkpoint information...succeeded Initializing dbspaces...succeeded Opening primary chunks...succeeded Validating chunks...succeeded Creating database partition...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

然后使用ps -ef|grep oninit查看到数据库正常启动了,也能使用dbaccess连接数据库了。

对比了下正常安装和出现问题的服务器,出现问题的服务器swap没有开启,因为这台服务器上也部署了ES测试环境,关闭了swap,当开启了swap,再重新安装确实很快,也没出现初始化失败的问题。

四、附录

以下是复现的初始化失败的操作记录

[root@xsky-node3 install]# cd /opt/gbase/etc/
[root@xsky-node3 etc]# su gbasedbt
[gbasedbt@xsky-node3 etc]$ sh GBaseInit_gbasedbt.sh 

Initializing Program...OK

ENTER THE INSTANCE INFORMATION or PRESS <ENTER> TO ACCEPT THE DEFAULT.

ENTER GBASE INSTANCE NAME (GBASEDBTSERVER) [Default:gbaseserver]: XXXXXX

GBASE INSTALL FOLDER LIST:
 1) /opt/gbase
CHOOSE GBASE INSTALL FOLDER(GBASEDBTDIR) [Default:/opt/gbase]: 

CHOOSE SERVICE IP ADDRESS FROM THE LIST:
 1) 127.0.0.1
 2) 10.110.7.41
ENTER THE NUMBER FOR YOUR CHOICE [Default:127.0.0.1]: 2

SPECIFY THE PORT NUMBER FOR GBASE [Default:9088]: 

INITIALIZE TYPE:
 1) TYPICAL -- Initialize the instance with all features configured with default values.
 2) CUSTOM  -- Initialize the instance with specific features that you need.
ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 2

GBASE CHARACTER SET LIST:
 1) en_US.8859-1
 2) zh_CN.GB18030-2000
 3) zh_CN.utf8
ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 3

ENTER THE DATA SPACE PATH [Default:/opt/gbase/XXXXXX_dbs]: 

ENTER THE LOGICAL LOG DBSPACE SIZE(MB) [Default:10000]: 

ENTER THE PHYSICAL LOG DBSPACE SIZE(MB) [Default:10000]: 

ENTER THE SMART LOB DBSPACE SIZE(MB) [Default:2030]: 

ENTER THE TEMPORARY DBSPACE SIZE(MB) [Default:2030]: 

ENTER "Y" TO START DATABASE ADVANCED SETTINGS, OR ENTER "N" TO ACCEPT DEFAULT VALUES: [Default:N]: Y

ENTER THE NUMBER OF DATA DBSPACES [Default:1]: 

ENTER THE NUMBER OF TEMP DBSPACES [Default:1]: 

Enter "Y" TO ENABLE ENVIRONMENT GL_USEGLU, OR ENTER "N" TO DISABLE: [Default:N]: Y

INSTANCE SUMMARY:
  Instance name:               XXXXXX
  GBase install directory:     /opt/gbase
  IP address & port:           10.110.7.41:9088
  Character set:               zh_CN.utf8
  Logical log space size:      10000 MB
  Physical log space size:     10000 MB
  Smart LOB space size:        2030 MB
  Temp DBSpace size:           2030 MB
  Data path:                   /opt/gbase/XXXXXX_dbs
  Data path free size:         277549 MB
  The number of data DBSpace:  1
  The number of temp DBSpace:  1
  Environment GL_USEGLU:       1

Enter "Y" to Start database initializing, or Enter "N" to Edit Again: Y

Touching Chunks...OK
Create sqlhosts File:  /opt/gbase/etc/sqlhosts.XXXXXX ...OK
Setting Parameters in /opt/gbase/etc/onconfig.XXXXXX :
ROOTPATH.ROOTSIZE.DBSERVERNAME.FULL_DISK_INIT.SBSPACENAME.SYSSBSPACENAME.DBSPACETEMP.LOGFILES.MULTIPROCESSOR.VPCLASS.NETTYPE.CLEANERS.DEF_TABLE_LOCKMODE.DIRECT_IO.LOCKS.TAPEDEV.LTAPEDEV.CKPTINTVL.DS_MAX_QUERIES.DS_TOTAL_MEMORY.DS_NONPDQ_QUERY_MEM.PHYSBUFF.LOGBUFF.AUTO_TUNE.MSGPATH.SERVERNUM.ALLOW_NEWLINE.TEMPTAB_NOLOG.DUMPSHMEM.USEOSTIME.STACKSIZE.ON_RECVRY_THREADS.OFF_RECVRY_THREADS.USELASTCOMMITTED.SHMVIRTSIZE.SHMADD.GBASEDBTCONTIME.BUFFERPOOL2K.BUFFERPOOL16K...AUTO_CKPTS.OK
Initializing Root DBSpace & Share Memory...OK
Creating system database..............................GBaseInit_gbasedbt.sh: line 955: [: !=: unary operator expected
OK
Creating logical log Dbspace...OK
Creating physical log Dbspace...OK
Creating smart LOB Dbspace...OK
Creating temp Dbspace.1...OK
Creating data Dbspace.1...OK
Setting dbscheduler...OK
Moving physical log...OK
Adding 40 logical logs: 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40...OK
Setting data chunks extendable...OK
Cleaning logical logs in rootdbs...Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'XXXXXX'
.Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'XXXXXX'
.Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'XXXXXX'
.Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'XXXXXX'
OK
Database restarting.......Your evaluation license will expire on 2024-10-17 00:00:00
Your evaluation license will expire on 2024-10-17 00:00:00

Initalize Failed,See Message Log File: /opt/gbase/etc/online_XXXXXX.log For Details
Creating database: gbasedb...OK

Now you can use this URL to connect to gbasedb:
jdbc:gbasedbt-sqli://10.110.7.41:9088/gbasedb:GBASEDBTSERVER=XXXXXX;DB_LOCALE=zh_CN.utf8;CLIENT_LOCALE=zh_CN.utf8;NEWCODESET=UTF8,utf8,57372;GL_USEGLU=1

Version:
Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'XXXXXX'
Build Number:           3.5.0_3X2_4_e44ff2

GBase Initializing Finished!

Initialize log file : ./InitGBaseDB_202310181403.log 

Press <ENTER> to Exit and Logout...



[gbasedbt@xsky-node3 etc]$ onstat -m
Your evaluation license will expire on 2024-10-17 00:00:00
shared memory not initialized for GBASEDBTSERVER 'silkinfo'

Message Log File: /opt/gbase/etc/online_silkinfo.log

10/18/23 16:18:37  Assert Warning: chunk failed sanity check

10/18/23 16:18:37  GBase Database Server Version 12.10.FC4G1TL
10/18/23 16:18:37   Who: Session(1, gbasedbt@xsky-node3, 0, 0x82448028)
                Thread(7, main_loop(), 82401028, 8)
                File: rspartn.c Line: 10776
10/18/23 16:18:37   Results: Chunk 1 is being taken OFFLINE.
10/18/23 16:18:37   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.
10/18/23 16:18:37  stack trace for pid 13981 written to /opt/gbase/tmp/af.3ef94dd
10/18/23 16:18:37   See Also: /opt/gbase/tmp/af.3ef94dd
10/18/23 16:18:37  chunk failed sanity check

10/18/23 16:18:38  I/O error, Primary Chunk '/opt/gbase/silkinfo_dbs/rootdbs' -- Offline (sanity)
10/18/23 16:18:38  oninit: Fatal error in shared memory initialization

[gbasedbt@xsky-node3 etc]$ 
[gbasedbt@xsky-node3 etc]$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x6c006304 0          zabbix     600        995952     15                      
0x018cba81 32792      omm        600        4688169288 1                       
0x52564801 32795      root       660        9048064    2                       
0x52564802 32796      root       660        103809024  2                       
0x52564803 32797      root       660        67108864   2                       




[gbasedbt@xsky-node3 tmp]$ cd
[gbasedbt@xsky-node3 ~]$ cd -
/opt/gbase/tmp
[gbasedbt@xsky-node3 tmp]$ ll
total 948
-rw-rw---- 1 gbasedbt gbasedbt  12125 Oct 18 16:18 af.3ef94dd
-rw-rw---- 1 gbasedbt gbasedbt 940864 Oct 18 16:18 af.3ef94dd.rawstk
-rwxrw-r-- 1 root     root       2407 Oct 18 13:53 ids_unixpost.sh
-rw-rw-r-- 1 gbasedbt gbasedbt    452 Oct 18 16:18 online.con
-rw-rw---- 1 root     gbasedbt    921 Oct 18 16:18 startup.silkinfo
-rw-rw-r-- 1 gbasedbt gbasedbt    155 Oct 18 15:51 URL.txt
[gbasedbt@xsky-node3 tmp]$ rm -f af.3ef94dd*
[gbasedbt@xsky-node3 tmp]$ ll
total 16
-rwxrw-r-- 1 root     root     2407 Oct 18 13:53 ids_unixpost.sh
-rw-rw-r-- 1 gbasedbt gbasedbt  452 Oct 18 16:18 online.con
-rw-rw---- 1 root     gbasedbt  921 Oct 18 16:18 startup.silkinfo
-rw-rw-r-- 1 gbasedbt gbasedbt  155 Oct 18 15:51 URL.txt
[gbasedbt@xsky-node3 tmp]$ ls -lart
total 24
-rwxrw-r--  1 root     root     2407 Oct 18 13:53 ids_unixpost.sh
drwxr-xr-x 21 gbasedbt gbasedbt 4096 Oct 18 14:04 ..
-rw-rw-r--  1 gbasedbt gbasedbt  155 Oct 18 15:51 URL.txt
-rw-rw-r--  1 gbasedbt gbasedbt  452 Oct 18 16:18 online.con
-rw-rw----  1 root     gbasedbt  921 Oct 18 16:18 startup.silkinfo
-rw-rw-rw-  1 gbasedbt gbasedbt  214 Oct 18 16:18 .silkinfo.alarm
drwxrwx---  2 gbasedbt gbasedbt  109 Oct 18 16:46 .
[gbasedbt@xsky-node3 tmp]$ cd
[gbasedbt@xsky-node3 ~]$ oninit -ivy
Your evaluation license will expire on 2024-10-17 00:00:00
Reading configuration file '/opt/gbase/etc/onconfig.silkinfo'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 953930 kbytes...succeeded
Creating infos file "/opt/gbase/etc/.infos.silkinfo"...succeeded
Linking conf file "/opt/gbase/etc/.conf.silkinfo"...succeeded
Initializing rhead structure...rhlock_t 524288 (16384K)... rlock_t (929687K)... 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
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Validating chunks...succeeded
Creating database partition...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
最后修改时间:2023-10-25 20:47:23
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论