一、环境介绍
操作系统:Centos 7.6
KES版本:KingbaseES_V008R006C007B0024_Lin64_install.iso
JDK版本:JDK 1.8 +
二、安装前准备
1.创建用户
[root@kes1 /]# useradd kingbase
[root@kes1 /]# id kingbase
uid=1000(kingbase) gid=1000(kingbase) groups=1000(kingbase)
[root@kes1 /]#
2.创建目录
创建目录
#软件包路径
mkdir -p /home/kingbase/KingbaseES/V8
#软件安装目录
mkdir -p /opt/Kingbase/ES/V8
#数据路径
mkdir -p /data/Kingbase
赋权
chown kingbase:kingbase -R /home/kingbase/KingbaseES/V8
chown kingbase:kingbase -R /opt/Kingbase/
chown kingbase:kingbase -R /data/Kingbase/
3.修改内核参数
#查看内存大小
[root@kes1 ~]# free
total used free shared buff/cache available
Mem: 3861480 115316 3525084 11852 221080 3489296
Swap: 0 0 0
#内存为3861480*1024=3,954,155,520,shmmax大小为总内存小1字节
#修改内核参数
cat >> /etc/sysctl.conf <<EOF
#add by kingbase
fs.aio-max-nr= 1048576
fs.file-max= 6815744
kernel.shmall= 2097152
kernel.shmmax= 3954155519
kernel.shmmni= 4096
kernel.sem= 250 32000 100 128
net.core.rmem_default= 262144
vm.dirty_background_ratio=2
vm.dirty_ratio = 40
vm.overcommit_memory = 2
vm.overcommit_ratio = 90
vm.swappiness = 0
fs.file-max = 6815744
fs.nr_open = 20480000
#TCP端口使用范围
net.ipv4.ip_local_port_range = 10000 65000
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 6000
# 记录的那些尚未收到客户端确认信息的连接请求的最大值
net.ipv4.tcp_max_syn_backlog = 65536
# 每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目
net.core.somaxconn=1024
net.core.netdev_max_backlog = 32768
net.core.wmem_default = 8388608
net.core.wmem_max = 1048576
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_syn_retries = 2
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_wmem = 8192 436600 873200
net.ipv4.tcp_rmem = 32768 436600 873200
net.ipv4.tcp_mem = 94500000 91500000 92700000
net.ipv4.tcp_max_orphans = 3276800
EOF
#立即生效
[root@kes1 sysctl.d]# sysctl -p
4.修改用户限制
cat >> /etc/security/limits.conf <<EOF
#add by kingbase
kingbase soft nproc 65536
kingbase hard nproc 65536
kingbase soft nofile 65536
kingbase hard nofile 65536
kingbase soft stack 10240
kingbase hard stack 32768
kingbase soft core unlimited
kingbase hard core unlimited
EOF
5.关闭SWAP
[root@kes1 sysctl.d]# swapoff -a
[root@kes1 sysctl.d]# free -m
total used free shared buff/cache available
Mem: 3770 113 3426 11 230 3398
Swap: 0 0 0
[root@kes1 sysctl.d]#
6.关闭SElinux 和防火墙
#关闭SElinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# 关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
7.安装JAVA
#解压
tar -zxf jdk-8u361-linux-x64.tar.gz
#配置环境变量
cat > /etc/profile.d/kes.sh <<EOF
export JAVA_HOME=/root/jdk1.8.0_361
export KINGBASE_DATA=/data/Kingbase/
export CLASSPATH=.:/root/jdk1.8.0_361/lib/
export PATH=$PATH:/root/jdk1.8.0_361/bin:/opt/Kingbase/bin
EOF
#重新登录或source ~/.bash_profile
[root@kes1 ~]# java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)
三、安装过程
挂载安装介质
mount -o loop /root/KingbaseES_V008R006C007B0024_Lin64_install.iso /mnt
cp -r /mnt/* /home/kingbase/KingbaseES/V8/
chown kingbase:kingbase -R /home/kingbase/KingbaseES/
[root@kes1 ~]# ll /home/kingbase/KingbaseES/V8/
total 4
dr-xr-xr-x. 2 kingbase kingbase 54 Aug 19 00:01 setup
-r-xr-xr-x. 1 kingbase kingbase 3829 Aug 19 00:01 setup.sh
静默安装
编辑静默配置文件
su - kingbase
cd KingbaseES/V8/
cp ./setup/silent.cfg ./install.properties
chmod 775 install.properties
配置文件参考如下
#license file path, for example /home/kingbase/license_1309_0-sales.dat for linux or C:\\license_1309_0-sales.dat for windows
KB_LICENSE_PATH=/home/kingbase/license_29404_0.dat
#install set, options are Full, Client, Custom
CHOSEN_INSTALL_SET=Full
#component list, options are SERVER, KSTUDIO, KDTS, INTERFACE, DEPLOY, KINGBASEHA
CHOSEN_FEATURE_LIST=SERVER,KSTUDIO,KDTS,INTERFACE,DEPLOY,KINGBASEHA
#install dir path, for example /opt/Kingbase/ES/V8 for linux or C:\\Program Files\\Kingbase\\ES\\V8 for windows
USER_INSTALL_DIR=/opt/Kingbase/ES/V8
#data dir path, for example /opt/Kingbase/ES/V8/data for linux or C:\\Program Files\\Kingbase\\ES\\V8\\data for windows
USER_SELECTED_DATA_FOLDER=/data/Kingbase
#init db params
#server port, requied, between 1 and 65535
DB_PORT=54321
#user name, required, length less than 63 bytes
DB_USER=system
#password, required
DB_PASS=123
#password confirm, required
DB_PASS2=123
#encoding, required, options are UTF8, GBK, GB18030
ENCODING_PARAM=UTF8
#compatibility mode, required, options are ORACLE, PG
DATABASE_MODE_PARAM=PG
#case sensitivity, required, options are YES, NO
CASE_SENSITIVE_PARAM=YES
#block size, required, options are 8k, 16k, 32k
BLOCK_SIZE_PARAM=8k
开始安装
./setup.sh -i silent -f install.properties
查看安装结果
echo $?
#若退出码为0,表示“安装成功,没有任何错误和警告”;
#若退出码为1,表示“安装成功,出现警告或非致命错误”。
#安装程序退出之后,如果没有正确安装,您可在${安装目录}/install/Logs下打开文件名如KingbaseES_V8_安装_*.log的日志文件排查错误原因。