1 安装CentOS系统
1.1 更改时区
1.2 添加中文支持
1.3 选择最小化安全
1.4 使用默认自动分区
1.5 开启网络连接
1.6 开始安装
1.7 设置root用户密码
1.8 安装完成重启
1.9 更新系统
2 安装Gbase8s 数据库依赖
2.1 核心依赖
2.2 JDK8
[root@localhost ~]# yum install -y java-1.8.0-openjdk
2.3 zip unzip
[root@localhost ~]# yum install -y zip unzip
3 创建数据库用户和安装目录
3.1 创建用户
[root@localhost ~]# groupadd gbasedbt
[root@localhost ~]# useradd -g gbasedbt -d /home/gbasedbt -s /bin/bash -m gbasedbt
[root@localhost ~]# passwd gbasedbt
3.2 创建目录
[root@localhost ~]# mkdir -p /opt/GBASE/gbase
[root@localhost ~]# chown gbasedbt:gbasedbt /opt/GBASE/gbase
4 上传并解压安装介质文件
4.1 上传
4.2 解压
[root@localhost ~]# ls -l
[root@localhost ~]# mv GBase8sV8.8_TL_2.0.1A2_2_RHEL6_x86_64.tar /opt/
[root@localhost ~]# cd /opt/
[root@localhost opt]# ls -l
[root@localhost opt]# tar -vxf GBase8sV8.8_TL_2.0.1A2_2_RHEL6_x86_64.tar
[root@localhost opt]# ls -l
5 执行数据库安装
6 进行数据库配置
6.1 环境变量
[root@localhost opt]# su - gbasedbt
[gbasedbt@localhost ~]$ ls -al
[gbasedbt@localhost ~]$ vi .bash_profile
export GBASEDBTSERVER=gbaseserver
export GBASEDBTDIR=/opt/GBASE/gbase
export ONCONFIG=onconfig.gbaseserver
export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/sqlhosts.gbaseserver
export PATH=$GBASEDBTDIR/bin:/usr/bin:${PATH}:.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GBASEDBTDIR/lib:$GBASEDBTDIR/lib/esql:$GBASEDBTDIR/lib/cli
export DB_LOCALE=zh_cn.GB18030-2000
export CLIENT_LOCALE=zh_cn.GB18030-2000
[gbasedbt@localhost ~]$ source .bash_profile
6.2 监听
[gbasedbt@localhost ~]$ pwd
/home/gbasedbt
[gbasedbt@localhost ~]$ cd /opt/GBASE/gbase/etc/
[gbasedbt@localhost etc]$ ls -l sqlhosts*
-rw-r--r--. 1 gbasedbt gbasedbt 11993 Aug 30 2018 sqlhosts.ext.demo
-rw-r--r--. 1 gbasedbt gbasedbt 2107 Aug 30 2018 sqlhosts.std
[gbasedbt@localhost etc]$ cp sqlhosts.std sqlhosts.gbaseserver
[gbasedbt@localhost etc]$ vi sqlhosts.gbaseserver
6.3 配置文件
[gbasedbt@localhost etc]$ ls -l onconfig*
-rw-r--r--. 1 gbasedbt gbasedbt 78988 Aug 30 2018 onconfig.std
[gbasedbt@localhost etc]$ cp onconfig.std onconfig.gbaseserver
[gbasedbt@localhost etc]$ vi onconfig.gbaseserver
更改ROOTPATH 为 $GBASEDBTDIR/chunks/rootchk
改TAPEDEV /dev/tapedev 为TAPEDEV /dev/null
和LTAPEDEV /dev/tapedev为LTAPEDEV /dev/null
不做备份
配置实例名为gbaseserver 要与环境变量内设置的一致
[gbasedbt@localhost gbase]$ mkdir chunks
[gbasedbt@localhost gbase]$ cd chunks/
[gbasedbt@localhost chunks]$ ls -l
total 0
[gbasedbt@localhost chunks]$ touch rootchk
[gbasedbt@localhost chunks]$ chmod 660 *
7 初始化启动
[gbasedbt@localhost chunks]$ cd
[gbasedbt@localhost ~]$ onstat -
Your evaluation license will expire on 2021-03-26 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'
[gbasedbt@localhost ~]$ oninit -ivy
提示mode=5初始化成功
8 创建数据库空间
8.1 创建root
[gbasedbt@localhost ~]$ cd $GBASEDBTDIR/chunks/
[gbasedbt@localhost chunks]$ ls -l
total 300000
-rw-rw----. 1 gbasedbt gbasedbt 307200000 Mar 26 17:43 rootchk
[gbasedbt@localhost chunks]$ pwd
/opt/GBASE/gbase/chunks
[gbasedbt@localhost chunks]$ touch plogchk llogchk datachk1 tmpchk1 sbchk1
[gbasedbt@localhost chunks]$ chmod 660 *
[gbasedbt@localhost chunks]$ ls -l
total 300000
-rw-rw----. 1 gbasedbt gbasedbt 0 Mar 26 17:59 datachk1
-rw-rw----. 1 gbasedbt gbasedbt 0 Mar 26 17:59 llogchk
-rw-rw----. 1 gbasedbt gbasedbt 0 Mar 26 17:59 plogchk
-rw-rw----. 1 gbasedbt gbasedbt 307200000 Mar 26 17:57 rootchk
-rw-rw----. 1 gbasedbt gbasedbt 0 Mar 26 17:59 sbchk1
-rw-rw----. 1 gbasedbt gbasedbt 0 Mar 26 17:59 tmpchk1
[gbasedbt@localhost chunks]$ onspaces -c -d plogdbs -p /opt/GBASE/gbase/chunks/plogchk -o 0 -s 204800
[gbasedbt@localhost chunks]$ onspaces -c -d llogdbs -p /opt/GBASE/gbase/chunks/llogchk -o 0 -s 512000
[gbasedbt@localhost chunks]$ onspaces -c -d datadbs1 -p /opt/GBASE/gbase/chunks/datachk1 -o 0 -s 512000 -k 8
[gbasedbt@localhost chunks]$ onspaces -c -d tmpdbs1 -p /opt/GBASE/gbase/chunks/tmpchk1 -o 0 -s 512000 -k 8 -t
[gbasedbt@localhost chunks]$ onspaces -c -S sbdbs1 -p /opt/GBASE/gbase/chunks/sbchk1 -o 0 -s 204800
8.2 逻辑日志迁移出root
[gbasedbt@localhost chunks]$ onstat -l
[gbasedbt@localhost chunks]$ onparams -a -d llogdbs -s 100000
执行五遍
[gbasedbt@localhost chunks]$ onstat -l
查看成功添加的五个
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -l
[gbasedbt@localhost chunks]$ onmode -c
删除原先的逻辑文件
[gbasedbt@localhost chunks]$ onparams -d -l 1 -y
[gbasedbt@localhost chunks]$ onparams -d -l 2 -y
[gbasedbt@localhost chunks]$ onparams -d -l 3 -y
[gbasedbt@localhost chunks]$ onparams -d -l 4 -y
[gbasedbt@localhost chunks]$ onparams -d -l 5 -y
[gbasedbt@localhost chunks]$ onparams -d -l 6 -y
查看成果
[gbasedbt@localhost chunks]$ onstat -l
8.3 物理日志迁移出root
[gbasedbt@localhost chunks]$ onparams -p -s 200000 -d plogdbs -y
查看结果
9 处理防火墙
[gbasedbt@localhost chunks]$ su -
Password:
Last login: Thu Mar 26 20:11:42 CST 2020 on pts/2
[root@localhost ~]# firewall-cmd --state
running
[root@localhost ~]# firewall-cmd --get-active-zones
public
interfaces: eth0
[root@localhost ~]# firewall-cmd --list-ports
[root@localhost ~]# firewall-cmd --zone=public --add-port=9088/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-ports
9088/tcp
10 开机自启动
[root@localhost ~]# vi /usr/lib/systemd/system/gbasedbtd.service
[Unit]
Description=GBase 8s Database Server
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=oneshot
User=gbasedbt
Group=gbasedbt
RemainAfterExit=yes
EnvironmentFile=/etc/sysconfig/gbasedbtd_service
ExecStart=/opt/GBASE/gbase/bin/oninit
ExecStop=/opt/GBASE/gbase/bin/onmode -ky
#Restart=on-abort
[Install]
WantedBy=multi-user.target
[root@localhost ~]# vi /etc/sysconfig/gbasedbtd_service
# gbasedbtd.service environmental variables
GBASEDBTDIR=/opt/GBASE/gbase
GBASEDBTSERVER=gbaseserver
ONCONFIG=onconfig.gbaseserver
GBASEDBTSQLHOSTS=/opt/GBASE/gbase/etc/sqlhosts.gbaseserver
11 dbaccess创建数据库
[root@localhost ~]# su - gbasedbt
[gbasedbt@localhost ~]$ dbaccess
12 最后,reboot 看上帝