GBase 8s
运维管理
文章

8s 自启动的两种方法

发表于2024-07-19 10:42:29541次浏览5个评论

1、cd /home/gbasedbt

2、vi start.sh
添加如下内容
source /home/gbasedbt/profile.gbaseserver;
oninit -vy;

3、vi /etc/rc.local(文件需要执行权限)
添加如下内容
su - gbasedbt <<EOF
sh /home/gbasedbt/start.sh;
exit;
EOF

4、chmod 777 /etc/rc.local  (文件执行权限)

 


详细步骤如下:

1.创建gbasedbtd.service文件

# vim /usr/lib/systemd/system/gbasedbtd.service

[Unit]
Description=GBase 8s Database Server v8.7 2.0.1a2_2
Documentation=file:/opt/gbase/release/en_us/0333
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/bin/oninit
ExecStop=/opt/gbase/bin/onmode -ky
#Restart=on-abort

[Install]
WantedBy=multi-user.target

2.创建gbasedbtd_service文件

里面的内容根据安装gbase 8s后自动生成的环境变量文件(/home/gbasedbt/profile.gbaseserver)进行修改

# vim /etc/sysconfig/gbasedbtd_service

GBASEDBTSERVER=gbaseserver
GBASEDBTDIR=/opt/gbase
GBASEDBTSQLHOSTS=/opt/gbase/etc/sqlhosts.gbaseserver
ONCONFIG=onconfig.gbaseserver

3.启动命令

systemctl daemon-reload

systemctl start gbasedbtd.service      {启动gbasedbtd服务(数据库应未启动)}
systemctl status gbasedbtd.service
systemctl stop gbasedbtd.service

systemctl enable gbasedbtd.service   (设置gbasedbtd服务随系统启动)
systemctl disable gbasedbtd.service  (关闭gbasedbtd服务随系统启动)

评论

登录后才可以发表评论
GBase用户17638发表于 2年前
请问,我们自己开发的xbsa.so,现在onbar -b -L 0备份失败,报错如下
2024-07-19 11:04:20 11567 11565 Archive started on rootdbs, sbspace01, datadbs01, llogdbs, plogdbs (Requested Level 0).
2024-07-19 11:04:20 11567 11565 Begin level 0 backup rootdbs.
2024-07-19 11:04:20 11567 11565 Successfully connected to Storage Manager.
2024-07-19 11:04:20 11567 11565 XBSA Error (BSACreateObject): An unspecified XBSA error has occured: 80
2024-07-19 11:04:20 11567 11565 XBSA Error (BSAQueryObject): An unspecified XBSA error has occured: 80
2024-07-19 11:04:21 11567 11565 Archive on rootdbs, sbspace01, datadbs01, llogdbs, plogdbs ABORTED (Requested Level 0).
2024-07-19 11:04:21 11567 11565 Begin backup of critical file '/opt/gbase8s_a2_2/backups/ixbar.0'.
2024-07-19 11:04:21 11567 11565 Successfully connected to Storage Manager.
2024-07-19 11:04:21 11567 11565 XBSA Error (BSACreateObject): An unspecified XBSA error has occured: 80
2024-07-19 11:04:21 11567 11565 /opt/gbase8s_a2_2/bin/onbar_d complete, returning 80 (0x50)
请问是什么原因,下面是bar_dbug日志
用户头像
NiJaT发表于 2年前
@GBase用户17638:有问题请联系人工客服。
用户头像
路路路发表于 9个月前
赞~
用户头像
levvel发表于 7个月前
太有深度了!
用户头像
柒柒天晴发表于 2个月前
向大佬学习