Debian 10 installs Renda Jincang database V8

1. Official download link

https://www.kingbase.com.cn/rjcxxz/index.htm
Select the linux system installation package to download
insert image description here
and download the authorization file. In this example, select the development version. Note that the number of connections to the development board is limited to 10
https://www.kingbase.com.cn/sqwjxz/index.htm
insert image description here

The difference in authorization files is as follows
https://www.kingbase.com.cn/cyymcysm/index.htm

2. Official installation documents

https://help.kingbase.com.cn/v8/install-updata/install-linux/index.html

3. Install the database

3.1. Preparation before installation

3.1.1. Verify installation package md5

insert image description here
insert image description here

3.1.2. Mount and cancel the installation package mirror

Switch to the root user, mount the iso installation package of the Renda Jincang database in any location, for example, under the /kingbase directory,
create a new mounting directory /kingbase

mkdir /kingbase

Enter the directory where the iso is located, and modify the pathToIso here to the actual directory where the ISO is located.

cd pathToIso/KingbaseES_V008R006C007B0024_Lin64_install.iso

Execute the following command to mount the image:

mount  cd pathToIso/KingbaseES_V008R006C007B0024_Lin64_install.iso /kingbaseES/

In order to use it in the future, you need to mount the iso again, copy the iso installation package to any directory on the operating system, this example is the /home/package directory

cp -r /kingbaseES/  /home/package

View the installation package

root@debian:/home/package# ls -l /home/package/kingbaseES/
total 8
dr-xr-xr-x 2 root root 4096 Apr  9 00:13 setup
-r-xr-xr-x 1 root root 3829 Apr  9 00:11 setup.sh
root@debian:/home/package# ls -l /home/package/kingbaseES/*
-r-xr-xr-x 1 root root 3829 Apr  9 00:11 /home/package/kingbaseES/setup.sh

/home/package/kingbaseES/setup:
total 2606076
-r-xr-xr-x 1 root root 2668607786 Apr  9 00:13 install.bin
-r-xr-xr-x 1 root root         46 Apr  9 00:13 MD5
-r--r--r-- 1 root root       1418 Apr  9 00:13 silent.cfg
root@debian:/homepackage# 

Unmount the installation package mirror

umount /kingbaseES

At this time, KingbaseES has unmounted the relationship with the iso file, and you will no longer see installation-related files in the KingbaseES directory.

root@debian:/home/package# cd /kingbaseES/
root@debian:/kingbaseES# ls -la
total 8
drwxr-xr-x  2 root root 4096 Apr  9 00:09 .
drwxr-xr-x 23 root root 4096 Apr  9 00:09 ..
root@debian:/kingbaseES# 

3.1.3. Kernel parameter setting manual

为了避免在KingbaseES安装和使用过程中出现问题,需要检查和设置内核参数。
  • Kernel parameter viewing command
parameter view command
semmsl, semmns, semopm, and semmni # /sbin/sysctl -a
shmall, shmmax, and shmmni # /sbin/sysctl -a
file-max # /sbin/sysctl -a
ip_local_port_range # /sbin/sysctl -a
rmem_default # /sbin/sysctl -a
rmem_max # /sbin/sysctl -a
wmem_default # /sbin/sysctl -a
wmem_max # /sbin/sysctl -a
aio-max-nr # /sbin/sysctl -a
tcp_wmem # /sbin/sysctl -a
tcp_rmem # /sbin/sysctl -a
  • Kernel parameter reference value
parameter Reference file in
semmsl 250 /proc/sys/kernel/sem
semmns 32000
semopm 100
semmy 128
shmall 2097152 /proc/sys/kernel/shmall
shmmax Minimum: 536870912 Maximum: Physical memory value minus 1 byte Suggestion: Greater than half of physical memory /proc/sys/kernel/shmmax
shmmni 4096 /proc/sys/kernel/shmmni
file-max 6815744 /proc/sys/fs/file-max
aio-max-nr 1048576; Note: This parameter limits the number of concurrent requests. Should be set to avoid failure of the IO subsystem. /proc/sys/fs/aio-max-nr
ip_local_port_range Min: 9000; Max: 65500 /proc/sys/net/ipv4/ip_local_port_range
rmem_default 262144 /proc/sys/net/core/rmem_default
rmem_max 4194304 /proc/sys/net/core/rmem_max
wmem_default 262144 /proc/sys/net/core/wmem_default
wmem_max 1048576 /proc/sys/net/core/wmem_max
  • If the kernel parameters are inconsistent with the reference values, you can modify the parameters by editing the /etc/sysctl.conf file, as follows:
fs.aio-max-nr= 1048576
fs.file-max= 6815744
kernel.shmall= 2097152
kernel.shmmax= 4294967295
kernel.shmmni= 4096
kernel.sem= 250 32000 100 128
net.ipv4.ip_local_port_range= 9000 65500
net.core.rmem_default= 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
  • Resource Usage Parameters

Linux资源限制配置文件是/etc/security/limits.conf。限制用户可使用的资源数量对系统的稳定性非常重要。可以通过调整资源限制数量改进系统性能。limits.conf文件如下所示:

insert image description here
其中soft是一个警告值,hard是真正意义的阈值,超过系统就会报错,一般情况下两者设为同一个值。一般保持系统安装时的默认值即可。可配置的资源有如下种类:

resource item meaning
core Kernel file size (KB)
data Maximum data size (KB)
fsize Maximum file size (KB)
memlock Maximum locked memory address space (KB)
nofile Maximum number of open file descriptors
rss Maximum persistent settings size (KB)
stack Maximum stack size (KB)
cpu Max CPU time (minutes)
noproc Maximum number of processes
as Address Space Limit (KB)
maxlogins User maximum number of logins
maxsyslogins Maximum number of logins on the system
priority Priority of running user processes
locks The maximum number of file locks a user can hold
sigpending Maximum number of pending signals
msgqueue Maximum memory used by POSIX message queues (bytes)
nice The maximum possible promotion to a suitable priority
rtprio Maximum real-time priority
  • The nofile, noproc, and core parameters can be modified to the following values:
# *表示所有用户,可只设置root和kingbase用户
* soft nofile 65536
# 注意:设置nofile的hard limit不能大于/proc/sys/fs/nr_open,否则注销后将无法正常登陆
* hard nofile 65535
* soft nproc 65536
* hard nproc 65535
# unlimited表示无限制
* soft core unlimited
* hard core unlimited
  • RemoveIPC parameter

systemd-logind服务中引入的一个特性,是当一个用户退出系统后,会删除所有有关的IPC对象。该特性由/etc/systemd/logind.conf文件中的RemoveIPC参数控制。某些操作系统会默认打开,会造成程序信号丢失等问题(只有redhat7及以上和一些特殊的国产Linux的版本需要修改,改之前可先查看此项是否为默认yes)。设置RemoveIPC=no。 设置后重启服务:

systemctl daemon-reload
systemctl restart systemd-logind.service

3.1.4. Check kernel parameters

3.1.4.1、semmsl, semmns, semopm, and semmni

cat /proc/sys/kernel/sem

insert image description here

依次是semmsl, semmns, semopm, and semmni

man proc

只要系统环境实际值>=参考值即可

insert image description here
经对照参考值,需修改semopm=1000

3.1.4.2、shmall, shmmax, and shmmni

insert image description here

man proc

insert image description here
经对照 无需更改

3.1.4.3、file-max

配置要求:系统值>=建议值

man proc

insert image description here
insert image description here
经对照 无需更改

3.1.4.4、aio-max-nr

所允许的并发请求的最大个数
配置要求:实际值>=参考值
insert image description here
需要调整为参考值
在/etc/sysctl.conf 添加一行
fs.aio-max-nr= 1048576

3.1.4.5、ip_local_port_range

配置要求:实际值>=参考值
insert image description here
经对照 无需更改

3.1.4.6、rmem_default

默认的TCP数据接收窗口大小(字节)
配置要求:实际值>=参考值
insert image description here
需要调整为参考值
在/etc/sysctl.conf 添加一行
net.core.rmem_default= 262144

3.1.4.7、rmem_max

默认的TCP数据接收窗口大小(字节)
配置要求:实际值>=参考值
insert image description here
需要调整为参考值
在/etc/sysctl.conf 添加一行
net.core.rmem_max= 4194304

3.1.4.8、wmem_default

默认的TCP数据发送窗口大小(字节)。
配置要求:实际值>=参考值
insert image description here
需要调整为参考值
在/etc/sysctl.conf 添加一行
net.core.wmem_default= 262144

3.1.4.9、wmem_max

最大的TCP数据发送窗口(字节)。
配置要求:实际值>=参考值
insert image description here
需要调整为参考值
在/etc/sysctl.conf 添加一行
net.core.wmem_max= 1048576

3.1.4.10、内核参数修改完毕后,查看内核参数的修改是否正确

输入如下命令查看内核参数的修改是否正确

/sbin/sysctl -p
/sbin/sysctl -a

3.1.4.11、核对资源使用参数

参考修改
nofile、noproc、core参数可修改为如下值

# *表示所有用户,可只设置root和kingbase用户
* soft nofile 65536
# 注意:设置nofile的hard limit不能大于/proc/sys/fs/nr_open,否则注销后将无法正常登陆
* hard nofile 65535
* soft nproc 65536
* hard nproc 65535
# unlimited表示无限制
* soft core unlimited
* hard core unlimited

修改/etc/security/limits.conf

vi /etc/security/limits.conf

添加以下几行

kingbase soft nofile 65536
root soft nofile 65536
kingbase hard nofile 65535
root hard nofile 65535
kingbase soft nproc 65536
root soft nproc 65536
kingbase hard nproc 65535
root hard nproc 65535
kingbase soft core unlimited
root soft core unlimited
kingbase hard core unlimited
root hard core unlimited

最终效果如下:

insert image description here

3.1.4.12、核对RemoveIPC参数

配置要求:参数值为no
使命以下命令查看参数值

grep RemoveIPC  /etc/systemd/logind.conf

Debian 10系统默认没有配置,默认是yes
insert image description here
insert image description here
修改前查看参数
insert image description here
修改为no
insert image description here
修改后重启服务

systemctl daemon-reload
systemctl restart systemd-logind.service

修改后查看参数
insert image description here

3.1.4.13、重启系统

重启系统

3.1.5、创建安装用户

在安装KingbaseES时,安装用户对于安装路径需有“读”、“写”、“执行”的权限。
在Linux系统中,需要以非root用户执行安装程序,且该用户要有标准的home目录。

因此,建议在正式安装前,新建kingbase用户作为KingbaseES专用的系统用户,
可以先使用root用户运行如下命令创建kingbase用户:
useradd -m kingbase -s /bin/bash
注意!!!
创建安装系统用户kingbase之后,如无特殊说明,本教程后续的操作默认使用kingbase用户进行操作。
该命令会同时创建同名用户组kingbase以及用户根目录/home/kingbase。继续运行如下命令设置kingbase用户的密码:
passwd kingbase

3.1.6、安装目录

KingbaseES默认的安装目录是 /opt/Kingbase/ES/V8 。
如果不存在,您需要使用root用户先创建该目录,并赋予kingbase用户对该目录的读写权限。
也可以自定义安装路径。如自定义安装路径为 mkdir -p /home/kingbase/ES/V8 ,
使用kingbase用户创建目录的命令如下:

此例使用自定义安装目录

如果上一步创建用户时没有指定-s /bin/bash 就会报如下错误。已指定忽略下述内容。

su - kingbase
mkdir -p /home/kingbase/ES/V8

以下报错供参考
报错 切换不到kingbase用户
insert image description here
是因为useradd命令添加用户时,如果没有指定-s shell,默认的shell是/bin/sh。
因此删除kingbase,重新建立kingbase用户
useradd -m kingbase -s /bin/bash

3.1.7、数据目录

数据目录是KingbaseES中存放数据文件的目录,默认是在安装目录下的data目录。
也可以与安装目录分开单独设置。您可以根据业务系统数据量来单独设置数据目录路径,
例如将数据目录初始化在本机硬盘或者挂载在盘阵上。 您可以运行如下命令创建数据目录:
mkdir  /home/kingbase/ES/V8/data
注意
数据目录不必事先创建。安装过程中会提示指定数据目录,如果目录不存在安装程序会自动创建。

3.2、安装

首先进入安装程序中setup.sh所在目录,以kingbase用户执行如下命令:

sh setup.sh -i console
选择1 回车

insert image description here

默认回车即可

insert image description here

下面一路回车 到这一步 输入Y 回车

insert image description here

默认回车 全量安装

insert image description here

输入license文件的绝对路径  回车

insert image description here

输入安装目录后回车,开始安装后会等待一段时间到完成,
完成安装后会进入初始化数据库

insert image description here

4、初始化数据库

4.1、选择数据目录

进入初始化数据库 选择数据目录,默认回车即可。
默认是安装目录下的data目录,会自动创建data目录。
也可以输入1个绝对路径作为数据目录。
insert image description here

4.2、选择数据库服务端口

默认回车即可,默认是54321。也可输入一个端口号进行自定义。
insert image description here

4.3、选择数据库管理员名称

默认回车即可,默认是system。也可输入一个名字字符串进行自定义。
insert image description here

4.4、选择数据库管理员密码

输入2次密码
insert image description here

4.5、选择数据库编码

默认回车即可,默认是UTF-8。也可输入数字进行自定义。
选择1:UTF-8
insert image description here

4.6、选择数据模型

默认回车即可,默认是oracle。也可输入数字进行自定义。
insert image description here

4.7、选择是否大小写敏感

自定义选择,看需求,比如说应用需要是不敏感,就选2。
insert image description here

4.7、选择数据库块大小

默认回车即可,默认是8K。也可输入数字进行自定义。
insert image description here

4.8、回车进行数据库初始化

Take it easy and wait for the initialization to complete.
insert image description here
Report an error
insert image description here
and install the Chinese character set zh_CN.UTF-8. Use
the space bar to select it. If * is displayed, it is selected.
insert image description here
The default charset selection is en_US.UTF-8. In Chinese, the terminal displays sometimes garbled characters.
insert image description here
insert image description here
View the local character set
insert image description here
and install it again, just press Enter

insert image description here
Press Enter again
insert image description here
and wait for the initialization to complete.

insert image description here
Enter to end the installation program

insert image description here

4.9. Registration system service

switch to root user

su -

Execute the command for service registration

 /home/kingbase/ES/V8/install/script/root.sh

insert image description here
View service startup settings

sysv-rc-conf --list|grep kingbase

insert image description here

View database service status

systemctl status kingbase.service

running
insert image description here
insert image description here

5. Login to the database

Switch to kingbase user

su - kingbase

Enter the Server/bin directory under the installation directory

cd ES/V8/Server/bin/

Connect to the database

./ksql -p 54321 -U system test

insert image description here
insert image description here

View the version information of the installed database

./kingbase ?V;

insert image description here

6. Uninstall the database

以kingbase用户登录系统后,进入${安装目录}/Uninstall目录,
执行如下命令,启动卸载程序。

insert image description here
By default, press Enter all the way to complete the uninstallation

7. Multi-instance management

7.1. Install the second database instance:

Switch to Kingbase user

su - kingbase

First enter the directory where setup.sh is located in the installer, and execute the following command to start the installer

sh setup.sh -i console
选择1 回车

insert image description here

默认回车即可

insert image description here

下面一路回车 到这一步 输入Y 回车

insert image description here

默认回车 全量安装

insert image description here

输入license文件的绝对路径  回车

insert image description here

输入安装目录:和已有实例安装目录不同的目录

insert image description here

默认回车即可

insert image description here

稍安勿躁,等待进度条完成

insert image description here

选择数据目录,默认回车即可

insert image description here

输入此实例端口:54322  回车

insert image description here

数据库管理员用户名 默认回车即可  默认数据库管理员是system

insert image description here

输入2次密码

insert image description here

数据库编码 默认回车即可  

insert image description here

数据模型 默认回车即可  默认是oracle

insert image description here

大小写敏感 选择2 根据应用需要选择

insert image description here

数据块大小 默认回车即可

insert image description here

默认回车

insert image description here

默认回车

insert image description here

7.2. Register this instance service

switch to root user

su -

Execute the registry service command

/home/kingbase/ES/V8-54322/install/script/root.sh

insert image description here

8. Windows client management tool

Official download link Select windows version to download
https://www.kingbase.com.cn/rjcxxz/index.htm
insert image description here

启动安装程序

insert image description here

安装时选择仅客户端组件进行安装

insert image description here

确认安装信息,点击安装

insert image description here

搜索kstudio 打开管理工具

insert image description here

新建数据库连接

insert image description here

查询表数据

insert image description here

Guess you like

Origin blog.csdn.net/OceanWaves1993/article/details/130035372