# Gbase8s安装与连接 **Repository Path**: binbin0915_admin/gbase8s ## Basic Information - **Project Name**: Gbase8s安装与连接 - **Description**: 安装gabse8s,使用桌面工具与springboot+mybatis连接。 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-09-03 - **Last Updated**: 2024-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Gbase8s安装与连接 #### 介绍 安装gabse8s,使用桌面工具与springboot+mybatis连接。安在centos7.x下 #### 安装教程 1. 安装准备 创建gbasedbt组与用户 [root@localhost ~]# groupadd gbasedbt [root@localhost ~]# useradd -g gbasedbt gbasedbt 为该用户创建密码 [root@localhost ~]# passwd gbasedbt 2. 创建空的安装目录 [root@localhost ~]# mkdir -p /opt/GBASE/gbase [root@localhost ~]# chown gbasedbt:gbasedbt /opt/GBASE/gbase 3. 上传安装包到某个目录,我放在/opt 并解压 [root@localhost ~]# cd /opt [root@localhost opt]# tar -vxf GBase8sV8.7_AEE_2.0.1A2_1_RHEL6_x86_64.tar ids_install onsecurity doc/ doc/ids_machine_notes_12.10.txt doc/ids_unix_relnotes_12.10.html ids.properties .gbase.properties 4. 开始安装 [root@localhost /]# cd /opt [root@localhost opt]# sh ids_install 4.1安装过程 4.1.1用不同意? DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y 4.1.2根据界面提示确认默认安装路径 /opt/GBASE/gbase 默认位置,直接回车。 4.1.3选择安装类型:ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS TO ACCEPT THE DEFAULT:: 输入 1 按回车 4.1.4系统提示是否创建一个实例,默认选项1为创建, 直接回车,创建一个实例。 4.1.5选择实例预期要支持的数据库用户数,默认选项为1, 直接回车继续。 其他没说明的地方全部回车。最后回车安装完成退出安装。 5.配置环境变量 在使用 GBase 8s 数据库服务前需要设置几个环境变量。 可以把安装目录下的 ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户主目录下的 .bash_profile文件中, 以便于 gbasedbt 用户在登录后即自动应用这些环境变量。 如果要把 GBase 8s 安装目录下的 ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户主目录下的 .bash_profile 文件中, 可以执行以下命令: [root@localhost ~]# cd /opt/GBASE/gbase [root@localhost gbase]# cat ol_gbasedbt1210.ksh >> /home/gbasedbt/.bash_profile [root@localhost ~]# cd /home/gbasedbt/ [root@localhost ~]# source .bash_profile *操作完环境变量后目前虽然可以启动了,但是当你虚拟机重启后启动会发现找不到命令 因此再root用户下操作以下内容: [root@localhost ~]# vim ~/.bash_profile 将这一行ource /home/gbasedbt/.bash_profile 酌加到他的后面。wq保存。 6.配置sqlhosts文件(在之前的环境变量中有服务实例名,启动配置文件名,使用的sqlhosts文件名及他们的位置) [root@localhost etc]# vim /opt/GBASE/gbase/etc/sqlhosts.ol_gbasedbt1210 将里面的内容前两行ip改成当前机器的IP地址 端口号也最好改成具体ip。如下。 ol_gbasedbt1210 onsoctcp 192.168.139.11 9088 dr_gbasedbt1210 drsoctcp 192.168.139.11 9088 lo_gbasedbt1210 onsoctcp 127.0.0.1 lo_gbasedbt1210 7.配置config文件 [root@localhost etc]# vim onconfig.ol_gbasedbt1210 使用vim的搜索功能,即是输入/S6_USE_REMOTE_SERVER_CFG 定位到该处,将该两处内容改为如下配置: REMOTE_SERVER_CFG remote.client REMOTE_USERS_CFG 6_USE_REMOTE_SERVER_CFG 1 然后创建remote.client文件,配置:连接端地址 用户名 连接时要用到。 用户必须是安装前创建的gbasedbt组下的组员 [root@localhost etc]# vim /opt/GBASE/gbase/etc/remote.client 172.18.2.182 gbasedbt (谁要连接的客户机ip:安装前组下的用户) 192.168.139.12 gbasedbt 保存 切换用户启动数据库 : su gbasedbt 8.命令介绍 oninit -vy 启动 onmode -ky 停止 onstat -g ntt 连接查看ip及端口 配置完一定重启下 端口号可可以用cat /etc/servrce查看 ol_gabseserver1210xxx的端口号是多少,sqlsosts里面也可以指定 在客户端用telnet ip port 试一下通不通。 如果报拒绝连接则是sqlsosts没配置好 如果是no route则是数据库服务器防火墙没关 9.桌面端连接(我不会传图片上来 这里口述) 主机:你服务器的ip 端口:我刚才sqlhost配的9088 实例名:ol_gbasedbt1210(环境变量中查看:vim /home/gbasedbt/.bash_profile 里面的GBASEDBTSERVER=ol_gbasedbt1210) 用户名:安装前gbasedbt组下的组员用户,配置文件也配置了 密码: 该用户的密码 10.springboot+Mybatis连接,见项目 注意的是,url后面的编码需要在dbaccess的session查看数据库编码什么的,连接不上就去看看 #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)