关键字:KingbaseES、V8R6、Silent、Java
一、环境准备
1、硬件环境支持
金仓数据库管理系统KingbaseES支持X86、X86_64,同时支持龙芯、飞腾等国产CPU硬件体系结构。
2、软件环境支持
金仓数据库管理系统KingbaseES支持各种主流的Linux操作系统32位及64位发行版本。
3、操作系统依赖包
1)准备需要安装的金仓数据库管理系统KingbaseES安装程序和jdk1.8及以上的jdk环境。
2)图形化环境准备
3)安装桌面组件包
yum -y groupinstall “GNOME Desktop”
yum -y groupinstall “X Window System”
4、创建操作系统用户
[root@node2 ~]# id kingbase
uid=1001(kingbase) gid=1001(kingbase) groups=1001(kingbase)
5、创建安装目录和数据存储目录
1)软件安装目录
[root@node1 ~]# mkdir -p /home/kingbase/V8R6/db
2)数据存储目录(建议将目录创建到独立的磁盘空间)
[root@node1 ~]# mkdir -p /home/kingbase/V8R6/db/data
[root@node1 ~]# chown -R kingbase.kingbase /home/kingbase/V8R6/db
6、内核参数配置
[root@node1 ~]# cat /etc/sysctl.conf
以上内容仅供参考,根据业务环境进行配置;配置相关参数后,执行sysctl -p使参数设置生效
7、配置资源配额
[root@node1 ~]# cat /etc/security/limits.conf
二、静默安装数据库
静默安装模式下,安装程序将读取配置文件来安装部署数据库。故使用静默安装模式进行数据库。安装部署时,需确保安装程序setup目录下存在名称为installer.properties的配置文件
1、创建软件包存储目录
默认通用机软件包为iso文件,通过mount到指定目录后(只读)无法将配置文件放在相同的存储路径下。可以将软件包和配置文件拷贝到指定的存储目录后,进行安装。
1)创建目录
[root@node1 v8r6]# mkdir -p /data1/soft/v8r6/install
[root@node1 v8r6]# chown -R kingbase.kingbase /data1/soft/v8r6/install
2)mount iso文件到指定目录
[root@node1 v8r6]# ls
KingbaseES_V008R006C004B0021_Lin64_single_install.iso license.dat
[root@node1 v8r6]# mount -o loop
KingbaseES_V008R006C004B0021_Lin64_single_install.iso /mnt
mount: /dev/loop0 is write-protected, mounting read-only
3)拷贝安装包到指定目录
[root@node1 v8r6]# cd /mnt
[root@node1 mnt]# ls
setup setup.sh
[root@node1 mnt]# cp -r * /data1/soft/v8r6/install
[root@node1 mnt]# ls -lh /data1/soft/v8r6/install/
total 4.0K
dr-xr-xr-x 2 root root 34 Mar 1 18:59 setup
-r-xr-xr-x 1 root root 3.8K Mar 1 18:59 setup.sh
2、创建配置文件(install.properties)
查看安装文件
[root@node1 install]# ls -lh
total 8.0K
-rw-r--r-- 1 root root 2.4K Mar 1 19:05 install.properties
dr-xr-xr-x 2 root root 34 Mar 1 18:59 setup
-r-xr-xr-x 1 root root 3.8K Mar 1 18:59 setup.sh
查看install.properties
[kingbase@node1 install]$ cat install.properties
# Wed Jan 31 12:14:47 CST 2018
# Replay feature output
# ---------------------
# This file was built by the Replay feature of InstallAnywhere.
# It contains variables that were set by Panels, Consoles or Custom Code.
#选择安装集
#----------
CHOSEN_FEATURE_LIST=SERVER,CLUSTER,JDBC,ODBC,REPLICA,DEPLOY,CONSOLE,HELP,MANAGER,DTS
CHOSEN_INSTALL_FEATURE_LIST=SERVER,CLUSTER,JDBC,ODBC,REPLICA,DEPLOY,CONSOLE,HELP,MANAGER,DTS
CHOSEN_INSTALL_SET=Full
#选择安装路径
#------------
USER_INSTALL_DIR=/home/kingbase/V8R6/db
#安装
#----
-fileOverwrite_/home/kingbase/V8R6/db/Uninstall/Uninstaller.lax=是
-fileOverwrite_/home/kingbase/V8R6/db/LICENSE_EN=是
-fileOverwrite_/home/kingbase/V8R6/db/LICENSE_ZH=是
-fileOverwrite_/home/kingbase/V8R6/db/Scripts/startupcfg.sh=是
-fileOverwrite_/home/kingbase/V8R6/db/Scripts/initcluster.sh=是
-fileOverwrite_/home/kingbase/V8R6/db/Scripts/root.sh=是
-fileOverwrite_/home/kingbase/V8R6/db/Scripts/rootuninstall.sh=是
-fileOverwrite_/home/kingbase/V8R6/db/Scripts/javatools.sh=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-uninstall.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-manager.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-dts.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-replication.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-deploy.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-console.desktop=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-ClientTools.directory=是
-fileOverwrite_/home/kingbase/V8R6/db/desktops/kdb-KingbaseESV8.directory=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-manager.png=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-uninstall.png=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-dts.png=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-console.png=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-replication.png=是
-fileOverwrite_/home/kingbase/V8R6/db/icons/hicolor/32x32/apps/kdb-deploy.png=是
#请为数据库目录选择文件夹
#------------------------
USER_SELECTED_DATA_FOLDER=/home/kingbase/V8R6/db/data
#设置初始化数据库参数
#--------------------
DB_PORT=54321
DB_USER=SYSTEM
DB_PASS=123456
DB_PASS2=123456
DB_ENCODING_UTF8=1
CASE-INSENSITIVE=0
3、静默安装数据库
进入指定安装路径:
[kingbase@node1 install]$ ls -lh
total 8.0K
-rw-r--r-- 1 kingbase kingbase 2.4K Mar 1 2021 install.properties
dr-xr-xr-x 2 kingbase kingbase 34 Mar 1 2021 setup
-r-xr-xr-x 1 kingbase kingbase 3.8K Mar 1 2021 setup.sh
[kingbase@node1 install]$ cd setup/
[kingbase@node1 setup]$ ls -lh
total 789M
-r-xr-xr-x 1 kingbase kingbase 789M Mar 1 2021 install.bin
-r--r--r-- 1 kingbase kingbase 46 Mar 1 2021 MD5
执行静默方式安装:
[kingbase@node1 setup]$ ./install.bin -i silent -f ../install.properties
Verifying JVM...You have mail in /var/spool/mail/kingbase
三、启动数据库和连接测试
拷贝license文件到安装目录下:
[kingbase@node1 v8r6]$ cp license.dat /home/kingbase/V8R6/db
启动并验证数据库。