暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GBase 8s数据库如何配置单机多实例

原创 ting 2022-05-25
916

1.现在机器上安装数据库并初始化一个实例(以gbase01为例)
2.配置环境变量
[gbasedbt@localhost ~]$ cp .bash_profile gbase02_profile
[gbasedbt@localhost ~]$ vim gbase02_profile (修改GBASEDBTSERVER为gbase02,与gbase01区分)
3. 配置onconfig文件
[gbasedbt@localhost ~]cd/opt/gbase8sa22/etc[gbasedbt@localhostetc]cd /opt/gbase8s_a2_2/etc [gbasedbt@localhost etc] cp onconfig.gbase01 onconfig.gbase02
[gbasedbt@localhost etc]$ vim onconfig.gbase02
修改参数:
ROOTPATH /data/gbase02/rootchk
PHYSFILE 50000
SERVERNUM 1
DBSERVERNAME gbase02
4. 创建gbase02的rootchk
[gbasedbt@localhost data]$ su - root
密码:
上一次登录:四 4月 14 17:32:43 CST 2022pts/0 上
[root@localhost ~]# cd /data
[root@localhost data]# mkdir gbase02
[root@localhost data]# chown gbasedbt:gbasedbt gbase02
[root@localhost data]# su - gbasedbt
上一次登录:四 4月 14 17:33:26 CST 2022pts/0 上
[gbasedbt@localhost ~]$ cd /data
[gbasedbt@localhost data]$ cd gbase02
[gbasedbt@localhost gbase02]$ touch rootchk
[gbasedbt@localhost gbase02]$ chmod 660 rootchk
[gbasedbt@localhost gbase02]$ ll
总用量 0
-rw-rw----. 1 gbasedbt gbasedbt 0 4月 14 17:51 rootchk
5. 配置sqlhosts文件(追加gbase02监听)
[gbasedbt@localhost etc]$ vim sqlhosts(两个实例的端口号要不一致)
gbase02 onsoctcp 0.0.0.0 9058
gbase01 onsoctcp 172.16.33.199 9088
6. 使环境变量生效
[gbasedbt@localhost ~]$ source gbase02_profile
7. 初始化实例
[gbasedbt@localhost ~]$ oninit –ivy
[gbasedbt@localhost ~]$ onstat -
Your evaluation license will expire on 2023-04-14 00:00:00
On-Line – Up 00:03:31 – 640264 Kbytes
8. 查看实例情况
[gbasedbt@localhost ~]$ onstat -g dis
Your evaluation license will expire on 2023-04-14 00:00:00
On-Line – Up 00:03:41 – 640264 Kbytes
There are 2 servers found
Server : gbase02
Server Number : 1
Server Type : IDS
Server Status : Up
Server Version: GBase Database Server Version 12.10.FC4G1TL
Shared Memory : 0x44000000
GBASEDBTDIR : /opt/gbase8s_a2_2
ONCONFIG : /opt/gbase8s_a2_2/etc/onconfig.gbase02
SQLHOSTS : /opt/gbase8s_a2_2/etc/sqlhosts
Host : localhost.localdomain

Server : gbase01
Server Number : 0
Server Type : IDS
Server Status : Up
Server Version: GBase Database Server Version 12.10.FC4G1TL
Shared Memory : 0x44000000
GBASEDBTDIR : /opt/gbase8s_a2_2
ONCONFIG : /opt/gbase8s_a2_2/etc/onconfig.gbase01
SQLHOSTS : /opt/gbase8s_a2_2/etc/sqlhosts
Host : localhost.localdomain

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论