添加下方脚本
export GBASEDBTSERVER=gbaseserver
export GBASEDBTDIR=/opt/GBASE/gbase #路径改为之前安装的路径/home/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
执行命令:source .bash_profile
底部添加服务器信息
修改环境信息
完善配置文件
onspaces -c -d plogdbs -p /home/gbase/gbase/chunks/plogchk -o 0 -s 204800
onspaces -c -d llogdbs -p /home/gbase/gbase/chunks/llogchk -o 0 -s 512000
onspaces -c -d datadbs1 -p /home/gbase/gbase/chunks/datachk1 -o 0 -s 512000 -k 8
onspaces -c -d tmpdbs1 -p /home/gbase/gbase/chunks/tmpchk1 -o 0 -s 512000 -k 8 -t
onspaces -c -S sbdbs1 -p /home/gbase/gbase/chunks/sbchk1 -o 0 -s 204800
执行:onparams -a -d llogdbs -s 100000 【 5次 】
删除原先的逻辑文件
剩下自己添加的5个
物理日志迁移出root
如果有防火墙,则需要设置放过数据库端口
1、
#root用户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=/home/gbase/gbase/bin/oninit
ExecStop=/home/gbase/gbase/bin/onmode -ky
#Restart=on-abort
[Install]
WantedBy=multi-user.target
2、
#root用户 vi /etc/sysconfig/gbasedbtd_service
# gbasedbtd.service environmental variables
GBASEDBTDIR=/home/gbase/gbase
GBASEDBTSERVER=gbaseserver
ONCONFIG=onconfig.gbaseserver
GBASEDBTSQLHOSTS=/home/gbase/gbase/etc/sqlhosts.gbaseserver
3、
#设置开机自启动systemctl enable gbasedbtd.service
数据库里通过键盘上下左右切换到对应选项,Enter确认