硬件要求
硬件 | 最低配置 | 推荐配置 |
处理器 | 1× 2 核 2.0GHz | 4×4 核 3.0GHz |
内存 | 4GB | 64GB 或更多 |
硬盘 | 100GB | 1TB |
光驱 | CD-ROM | CD-ROM |
系统要求
GBase 8s 产品支持多种处理器平台,除国际主流的 x86_64 处理器(包括 Intel 和 AMD)外,全面支持飞腾、鲲鹏、龙芯、兆芯、海光、申威等国产处理器。
GBase 8s 产品可以运行于多款操作系统,包括: RHEL和CentOS等Linux操作系统、统信UOS、麒麟、欧拉等国产操作系统。
安装准备
1. 创建 gbasedbt 组和用户
在启动安装过程之前,必须准备系统以确保您有足够权限来执行安装。您必须以 root 用户身份登录才能执行许多与安装有关的任务。 同时要求服务器操作系统上具有 gbasedbt 组和 gbasedbt 用户。
登录系统后可以执行以下命令创建 gbasedbt 组和 gbasedbt 用户:
[root@localhost ~]# groupadd gbasedbt
[root@localhost ~]# useradd -g gbasedbt gbasedbt
为 gbasedbt 用户设置密码,密码为 gbasedbt:
[root@localhost ~]# passwd gbasedbt
2. 创建 GBase 8s 数据库安装目录
GBase 8s 数据库缺省的安装目录为 /opt/GBASE/gbase,并且此文件夹必须为空。
[root@localhost ~]# mkdir -p /opt/GBASE/gbase
[root@localhost ~]# chown gbasedbt:gbasedbt /opt/GBASE/gbase
3. 上传并解压安装包
将产品安装光盘插入光驱,取出光盘中 Setup 目录下的文件,复制到本地目录 /opt。 Setup目录中包含 GBase 8s 产品的安装包文件,该文件通常是形如GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar 的压缩文件。
在本手册中,以 GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar为例进行安装说明。
解压该 tar 包,解压命令为: tar – vxf filename.tar。
[root@localhost ~]# cd /opt
[root@localhost opt]# tar -vxf
GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar
ids_install
onsecurity
ids.properties
.gbase.properties
安装方法-定制安装
定制安装, 也就是通常说的自定义安装。
使用定制安装可在安装 GBase 8s 时只带有您所需的功能部件。
1.执行安装
进入解压目录, 执行安装脚本 ids_install, 即可进行安装。 具体命令如下:
[root@localhost ~]# cd /opt
[root@localhost opt]# sh ids_install
定制安装过程如下所示:
1.接受授权协议。
在启动安装过程之前,必须准备系统以确保您有足够权限来执行安装。
您必须以 root 用户身份登录才能执行许多与安装有关的任务。 同时要求服务器操作系统上具有 gbasedbt 组和 gbasedbt 用户。
登录系统后可以执行以下命令创建 gbasedbt 组和 gbasedbt 用户:
[root@localhost ~]# groupadd gbasedbt
[root@localhost ~]# useradd -g gbasedbt gbasedbt
为 gbasedbt 用户设置密码,密码为 gbasedbt:
[root@localhost ~]# passwd gbasedbt
2.选择安装类型,输入 2 选择 Custom installation。
========================================================================= 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
下面所有选项,一律<回车>
========================================================================= "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/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: 497,274,517 Bytes Available: 9,861,873,664 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/gbase PRESS <ENTER> TO INSTALL: ========================================================================= Installing... ------------- [==================|==================|==================|==============] [------------------|------------------|------------------|--------------] ========================================================================== Installation Complete --------------------- Congratulations! GBase Software Bundle installation is complete. Product install status: GBase: Successful GBase Connect: Successful Main Version: GBase 8s V8.7 For more information about using GBase products, see the GBase Information Center at http://www.gbase.cn.
PRESS <ENTER> TO EXIT THE INSTALLER:
安装结束, 回车,退出安装。
2. 使用脚本自动创建和初始化实例
安装完成后, 将 GBseInit_gbasedbt.sh 脚本拷贝到 opt/GBASE/gbase 目录下。 更改此脚本的执行权限:
[root@localhost ~]# cd /opt/GBASE/gbase
[root@localhost gbase]# chown -R gbasedbt:gbasedbt GBaseInit_gbasedbt.sh
[root@localhost gbase]# ls -l GBaseInit_gbasedbt.sh -rw-r--r--. 1 gbasedbt gbasedbt 32705 Jan 15 10:10 GBaseInit_gbasedbt.sh
使用 gbasedbt 用户执行该脚本。 使用 GBseInit_gbasedbt.sh 脚本,自动创建并初始化实例。
[root@localhost gbase]# su gbasedbt [gbasedbt@localhost gbase]$ sh GBaseInit_gbasedbt.sh Initializing Program...OK ENTER THE INSTANCE INFORMATION or PRESS <ENTER> TO ACCEPT THE DEFAULT. // 创建实例名称,默认为 gbaseserver ENTER GBASE INSTANCE NAME (GBASEDBTSERVER) [Default:gbaseserver]: //选择安装目录。默认为 /opt/GBASE/gbase GBASE INSTALL FOLDER LIST: 1) /opt/GBASE/gbase CHOOSE GBASE INSTALL FOLDER(GBASEDBTDIR) [Default:/opt/GBASE/gbase]: //选择本机 IP 地址 CHOOSE SERVICE IP ADDRESS FROM THE LIST: 1) 192.168.127.101 2) 127.0.0.1 ENTER THE NUMBER FOR YOUR CHOICE [Default:192.168.127.101]: //指定数据库的监听端口,缺省为 9088 SPECIFY THE PORT NUMBER FOR GBASE [Default:9088]: //选择安装方式: 2 定制安装 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]: 2 //输入数据库空间存储路径 ENTER THE DATA SPACE PATH [Default:/opt/GBASE/gbase/gbaseserver_dbs]: //设置逻辑日志空间大小 ENTER THE LOGICAL LOG DBSPACE SIZE(MB) [Default:540]: //设置物理日志空间大小 ENTER THE PHYSICAL LOG DBSPACE SIZE(MB) [Default:540]: //设置智能大对象空间大小 ENTER THE SMART LOB DBSPACE SIZE(MB) [Default:138]: //设置临时数据空间大小 ENTER THE TEMPORARY DBSPACE SIZE(MB) [Default:138]: // 输入 Y 启动以上设置, N 重新进行配置 ENTER "Y" TO START DATABASE ADVANCED SETTINGS, OR ENTER "N" TO ACCEPT DEFAULT VALUES: [Default:Y]: Y
ENTER THE NUMBER OF DATA DBSPACES [Default:1]:
//实例配置如下所示: INSTANCE SUMMARY: Instance name: gbaseserver GBase install directory: /opt/GBASE/gbase IP address & port: 192.168.127.101:9088 Character set: zh_CN.GB18030-2000 Logical log space size: 430 MB Physical log space size: 430 MB Smart LOB space size: 116 MB Temp DBSpace size: 116 MB Data path: /opt/GBASE/gbase/gbaseserver_dbs Data path free size: 4292 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: Enter "Y" to Start database initializing, or Enter "N" to Edit Again: Y Touching Chunks...OK Create sqlhosts File: /opt/GBASE/gbase/etc/sqlhosts.gbaseserver ...OK Setting Parameters in /opt/GBASE/gbase/etc/onconfig.gbaseserver : ROOTPATH.ROOTSIZE.DBSERVERNAME.FULL_DISK_INIT.SBSPACENAME.SYSSBSPACENAME.D BSPACETEMP.LOGFILES.MULTIPROCESSOR.VPCLASS.NETTYPE.CLEANERS.DEF_TABLE_LOCK MODE.DIRECT_IO.LOCKS.TAPEDEV.LTAPEDEV.CKPTINTVL.DS_MAX_QUERIES.DS_TOTAL_ME MORY.DS_NONPDQ_QUERY_MEM.PHYSBUFF.LOGBUFF.AUTO_TUNE.MSGPATH.SERVERNUM.ALLO W_NEWLINE.TEMPTAB_NOLOG.DUMPSHMEM.USEOSTIME.STACKSIZE.ON_RECVRY_THREADS.OF F_RECVRY_THREADS.USELASTCOMMITTED.SHMVIRTSIZE.SHMADD.GBASEDBTCONTIME.BUFFE RPOOL2K.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.........OK Database restarting.......OK
Creating database: gbasedb...OK Now you can use this URL to connect to gbasedb: jdbc:gbasedbt-sqli://192.168.8.123:9088/gbasedb:GBASEDBTSERVER=gbaseserver ; Version: GBase Database Server Version 12.10.FC4G1AEE -- On-Line -- Up 00:00:13 -- 1121592 Kbytes Build Number: 2.0.1A2_N303 GBase Initializing Finished! Initialize log file : ./InitGBaseDB_201901081452.log Press <ENTER> to Exit and Logout...
自动创建和初始化实例完毕,回车退出。
3. 手动创建和初始化实例
您也可以按照如下步骤,手动创建实例并初始化。
(1)创建一个实例, 假设其实例名为“gbaseserver” 。
(2)创建一个实例需要配置以下三个文件,使用用实例名作为文件的后缀:
a) 环境变量文件名为 profile.gbaseserver
b) 配置参数文件名称为 onconfig.gbaseserver
c) sqlhosts 配置文件名称为 sqlhosts.gbaseserver
具体步骤如下:
1 创建数据库的数据文件存储目录 /dbs
以 root 身份登录, 进入安装目录,创建数据目录:
[root@localhost ~]# cd /opt/GBASE/gbase [root@localhost gbase]# mkdir dbs [root@localhost gbase]# cd dbs [root@localhost dbs]# touch rootdbs [root@localhost dbs]# chown gbasedbt:gbasedbt rootdbs
[root@localhost dbs]# chmod 660 rootdbs
2 配置 profile.gbaseserver 环境变量文件
切换到 gbasedbt 用户身份登录, 将默认环境变量 .bash_profile 文件复制一份, 命名为profile.gbaseserver,并对它进行编辑。
[root@localhost dbs]# su gbasedbt
[gbasedbt@localhost ~]$ cd /home/gbasedbt
[gbasedbt@localhost ~]$ cp .bash_profile profile.gbaseserver
[gbasedbt@localhost ~]$ vi profile.gbaseserver
(进入文件后按“i”建,开启 insert 模式)
注意: 根据实例的实际情况更改红色部分字段信息
export GBASEDBTSERVER=gbaseserver //实例名 export GBASEDBTDIR=/opt/GBASE/gbase //安装路径 export ONCONFIG=onconfig.gbaseserver //配置参数文件名称 export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/sqlhosts.gbaseserver //sqlhosts 文件名称 export PATH=$GBASEDBTDIR/bin:/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
完成之后保存退出。(第一步按 ESC ; 第二步 输入冒号“:” ; 第三步输入 wq 代表保存退出, q 代表退出, q! 代表强制退出。 最后回车)。
使环境变量生效:
[gbasedbt@localhost ~]$ source profile.gbaseserver
为了 gbasedbt 用户在登录后自动应用这些环境变量, 请执行以下操作:vi .bash_profile 文件, 此文件后添加以下内容。
source /home/gbasedbt/profile.gbaseserver
然后执行以下命令, 使环境变量生效:
[gbasedbt@localhost ~]$ source .bash_profile
3 配置 onconfig.gbaseserver 参数文件
将 /opt/BASE/gbase/etc/ 目录中的 onconfig.std 文档复制一份,命名为 $ONCONFIG 变量指定的名称 onconfig.gbaseserver。
[gbasedbt@localhost ~]$ cd /opt/GBASE/gbase/etc/
[gbasedbt@localhost etc]$ cp onconfig.std onconfig.gbaseserver
vi onconfig.gbaseserver 文件,配置以下参数并保存:
提示: vi 编辑器中模糊查找字符串“XXX”方法:输入” /XXX”后回车即可向下检索到该字符串位置。
ROOTPATH /opt/GBASE/gbase/dbs/rootdbs //系统数据库文件存储空间路径,参照步骤 1 中的设置
SERVERNUM 1 //实例编号,多实例中每个实例编号要唯一
DBSERVERNAME gbaseserver //数据库服务器实例名称
TAPEDEV /dev/null //用于存储空间备份的磁带设备
LTAPEDEV /dev/null //用于逻辑日志备份的磁带的设备路径
4 配置 sqlhosts.gbaseserver 文件
GBase 8s 数据库使用的监听端口默认为 9088,多实例中每个实例的端口必须唯一。将 /opt/GBASE/gbase/etc/ 目录中的 sqlhosts.std 文档复制一份,命名为GBASEDBTDQLHOSTS 变量指定的名称 sqlhost.gbaseserver。
[gbasedbt@localhost ~]$cd /opt/GBASE/gbase/etc/
[gbasedbt@localhost etc]$ cp sqlhosts.std sqlhosts.gbaseserver
vi sqlhosts.gbaseserver 文件, 在文件末尾添加相关实例名、 网络连接方式、 IP 及端口号。
[gbasedbt@localhost etc]$ vi sqlhosts.gbaseserver
在文件末尾按照如下格式添加内容并保存:
实例名 网络连接方式 IP 端口
gbaseserver onsoctcp 192.168.127.101 9088
5 初始化数据库
使用 gbasedbt 用户执行初始化命令:
[gbasedbt@localhost ~]$ oninit -ivy