1.现在机器上安装数据库并初始化一个实例(以gbase01为例)
2.配置环境变量
[gbasedbt@localhost ~]$ cp .bash_profile gbase02_profile
[gbasedbt@localhost ~]$ vim gbase02_profile (修改GBASEDBTSERVER为gbase02,与gbase01区分)
3. 配置onconfig文件
[gbasedbt@localhost ~]
c
d
/
o
p
t
/
g
b
a
s
e
8
s
a
2
2
/
e
t
c
[
g
b
a
s
e
d
b
t
@
l
o
c
a
l
h
o
s
t
e
t
c
]
cd /opt/gbase8s_a2_2/etc [gbasedbt@localhost etc]
cd/opt/gbase8sa22/etc[gbasedbt@localhostetc] 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