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 看上帝