GBase 8s 初学者常见问题

一、安装

1、安装过程中报“The version file is not exist.”错误

出现这个问题的原因可能为操作系统没有unzip命令。当在使用最小化安装的操作系统上安装GBase 8s时,安装程序先要对一些资源进行解压,由于没有unzip,gzip等一些基本命令,可能导致部分资源没有正确解压,在后续的访问中报如“The version file is not exist”类错误。

GBase 8s使用了商业的安装软件制作程序,商业的安装软件没有处理这些异常,GBase 8s安装程序暂时无法捕获这类异常并处理处理。

[root@centos1 install]# ./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
---------------

PRESS <ENTER> TO CONTINUE: 

===============================================================================
The version file is not exist.
------------------------------

The version file is not exist.

PRESS <ENTER> TO ACCEPT THE FOLLOWING (OK): 
[root@centos1 install]# 
2、安装过程中报“The specified installation path is not secure”错误。

出现这个问题的原因可能为:

安装目录被设置了过大的权限,导致其它用户有权限写数据库目录中的文件。这对于一个数据库系统来说,是非常严重的安全问题。建议检查安装目录的权限,并将安装目录及上级目录设置为755的权限。
在使用root用户安装时,指定了一个非root的文件夹,也可能出现上面错误。

The specified installation path is not secure. Either enter a different path or
exit the installation application and run the onsecurity utility.
root: onsecurity  "/opt/GBASE/"
Non root: onsecurity -p "/opt/GBASE/" 
3、启动数据库时报共享内存错误

安装好GBase 8s后,启动数据库报“Allocating and attaching to shared memory…FAILED”。出现这个错误主要是申请共享内存失败,需要检查两个方面:
(1) 是否已经启动数据库。当数据库实例已经处于运行状态时,再次执行oninit -vy时,会出现这个报错信息。可以使用onstat -命令,检查一下数据库实例的状态。
(2) 服务器中是否运行了其它应用程序,占用了大量的服务器内存,导致GBase 8s 在启动时,由于服务器内存不足而报错。可以使用free -g命令检查一下服务器的可用内存数量。

Your evaluation license will expire on 2022-06-09 12:00:00
oninit: Fatal error in shared memory creation
Reading configuration file '/opt/gbase/etc/onconfig.gbaseserver'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...FAILED

WARNING: server initialization failed or timed out.
Check the message log, online.log, for errors.
4、执行ids_install安装时,报“The version file is not exist.”

解析:操作系统确少必要的unzip工具,需要安装unzip。CentOS系统中可通过yum install unzip安装。

5、执行ids_install安装时,报“No Java virtual machine could be found from your PATH environment variable. You must install a VM prior to running this program.”

解析:提示信息为无Java虚拟机,按照提示安装JRE/JDK。支持的JRE/JDK版本为1.6及以上,如CentOS自带的java-1.8.0-openjdk。

6、执行ids_install安装时,报“The parent directory of the user install path is not exists, please choose another one.”

解析:提示信息为指定的目录上级目录不存在。默认的安装目录为:/opt/GBASE/gbase,如果/opt/GBASE目录不存在,则会报这个错误。需要在安装前创建/opt/GBASE目录。

7、执行ids_install安装时,报“User install directory is not empty, please chooose another one.”

解析:提示信息为指定的目录非空。安装数据库需要在空目录或者不存在的目录下(上级目录需存在,系统会自动创建目录),手工指定其它非空目录或者不存在目录(上级目录需存在,系统会自动创建目录)。

8、执行ids_install安装时,报

“./ids_install: line 3319: /tmp/install.dir.15072/Linux/resource/jre/jre/bin/java: cannot execute binary file
./ids_install: line 3319: /tmp/install.dir.15072/Linux/resource/jre/jre/bin/java: Success”

解析:提示信息是数据库安装包里自带的java命令是不能执行的二进制文件,原因是:当前的平台与数据库安装包使用的平台不同(如x86平台上使用了其它平台(飞腾、龙芯、Power等)的安装包)。X86平台对应的文件名后缀是x86_64.tar,飞腾平台对应的文件名后缀是FT.tar,龙芯平台对应的文件名后缀是Loongson3B.tar。

9、配置开机自启

请参考文章《GBase 8s 通过systemd实现自启动与关闭》。

二、应用

1、执行SQL语句时报“908: Attempt to connect to database server (gbaseserver_36) failed.”错误。

如果在本地操作GBase 8s 数据库报错,可能是数据库的服务没有启动,可以使用 onstat - 命令查看数据库是否在线。
如果不是访问本机的GBase 8s,需要检查一下安装GBase 8s 的服务器,是否开启了防火墙。请正确配置防火墙或关闭防火墙后再试。

[gbasedbt@train ~]$ dbaccess - -
Your evaluation license will expire on 2022-06-09 12:00:00
> create database demodb with log;

  908: Attempt to connect to database server (gbaseserver_36) failed.

  201: A syntax error has occurred.
Error in line 1
Near character position 1
> 
2、选择一个数据库时报“Database not found or no system permission”

当使用gbasedbt启动dbaccess时,出现上述问题,先检查一下,选择的数据库是否已经创建。

> database mydb;

Database closed.

  329: Database not found or no system permission.

  111: ISAM error:  no record found.
Error in line 1
Near character position 12
> 
3、执行数据库初始化或者启动数据库时,报

“Allocating and attaching to shared memory…FAILED
WARNING: server initialization failed or timed out.
Check the message log, online.log, for errors.”

解析:出现问题,根据提示要求查看online.log,使用onstat -m命令可查看最近20行online.log日志信息。如果日志里包含类似以下信息
“19:03:42 shmget: [EEXIST][17]: key 52564801: shared memory already exists
19:03:42 mt_shm_init: can’t create resident segment”,
表示数据库的内存段已经被占用,可能的情况是:
1)当前实例已经启动,即通过onstat -命令检查状态,如果已经是On-Line状态,即“GBase Database Server Version 12.10.FC4G1AEE – On-Line – Up 00:07:02 – 208516 Kbytes”
表示数据库不需要再初始化或者重新启动,保持现有状态即可。
2)当前实例未启动,即通过onstat -命令检查状态,如果已经是未启动状态,即“shared memory not initialized for GBASEDBTSERVER ‘ol_gbasedbt1210’”
则表示之前的数据库关闭或者异常时,内存未能及时释放,执行onclean -ky命令强制清理内存,然后通过ipcs -m命令查看key中与报错信息中一致的0x52564801是否存在,如果不存在,可以重新启动数据库实例;如果存在,使用root用户执行ipcrm -M 0x52564801清理共享内存,同时清理0x525648XX 开头各个内存段,完成后可以重新启动数据库实例。

4、执行数据库初始化或者启动数据库时,报

“Opening primary chunks…FAILED
oninit: Fatal error in shared memory initialization
WARNING: server initialization failed or timed out.
Check the message log, online.log, for errors. ”

解析:出现问题,根据提示要求查看online.log,使用onstat -m命令可查看最近20行online.log日志信息。如果日志里包含类似以下信息:
1)“19:07:08 The chunk ‘/opt/gbase/storage/rootdbs’ must have READ/WRITE permissions for owner and group (660).”
表示数据库使用的chunk对应的文件或者文件系统权限不对,按提示要求修改为属主及属组均为gbasbedbt,权限为660(即:chown gbasedbt:gbasedbt /opt/gbase/storage/rootdbs , chmod 660 /opt/gbase/storage/rootdbs),完成后重新启动数据库。
2)“19:10:51 The chunk ‘/opt/gbase/storage/rootdbs’ must have READ/WRITE permissions for owner (600).”
数据库使用的chunk对应的文件或者文件系统权限应为属主及属组均为gbasbedbt,权限为660,这里提示需要600权限。说明oninit可执行文件的属主及权限不对,或者是非root用户安装的数据库。我们要求使用root用户来安装数据库。故在$GBASEDBTDIR目录下,使用root用户执行RUNasroot.installserver脚本以完成对所有已安装的文件的权限修正。同时修改chunk文件或者文件系统的属主及属组均为gbasbedbt,权限为660(即:chown gbasedbt:gbasedbt /opt/gbase/storage/rootdbs , chmod 660 /opt/gbase/storage/rootdbs),完成后重新初始化实例或者重启实例。

5、连接数据库时,报 “908: Attempt to connect to database server (ol_gbasedbt1210) failed.”

解析:根据提示信息,表示当前无法连接到指定的数据库。对于此问题,需要从最底层往上排查。
首先,检查数据库的侦听是否正常,命令onstat -g ntt的输出结果中,thread name为soctcplst对应的address中应包括 主机名或IP地址|服务名称或者端口号|scotcp(如localhost.localdomain|ol_gbasedbt1210|soctcp),该信息来源地sqlhosts配置文件(建议在sqlhosts配置文件中指定IP地址及端口,而不是使用主机名或者服务名称)。如果不存在符合条件的soctcplst,则需要修改sqlhosts为正确配置,并重启数据库。如果存在soctcplst,但IP是本地loop地址(127.0.0.1),也需修改为实际物理IP,并重启数据库。
如果侦听正常,则继续检查操作系统防火墙设置,请关闭防火墙或者放通数据库使用的端口。

三、工具

1、如何解决dbaccess中不能使用方向键查看历史命令和左右移动问题。

可以使用rlwray处理一下,具体方法参考:
如何解决dbaccess中不能使用方向键查看历史命令和左右移动问题

2、GBase DataStudio连接参数配置

image001.png

解析:主机 -> 填写能访问到数据库服务器的IP地址或者域名(能通过ssh客户端访问)
端口 -> sqlhosts配置文件中的端口号(通过onstat -g ntt可看到)
实例名 -> $GBASEDBTSERVER配置参数
数据库/模式 -> create database语句创建的库。可使用系统库sysmaster
用户名 -> 操作系统用户,默认的系统用户是gbasedbt
密码 -> 用户名在操作系统上的密码(注意密码强度要求)

9,GBase DataStudio连接数据库报连接错误,如下图:
在这里插入图片描述

解析:该问题是指定的用户密码不符合密码强度要求(GBase 8s v8 2.0.1a2_2版本有密码强度要求,需要密码不少于8位且需包含大小写字母数字),在数据库服务器上执行onstat -m能看到“09:17:03 listener-thread: err = -961: oserr = 0: errstr = : The password is too simple.”信息。
修改用户密码以符合密码强度要求(最长可能需要15分钟生效)。

  • 0
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值