GBase 8s
安装配置
文章
修改数据库访问IP及端口
发表于2023-06-15 17:30:48750次浏览2个评论
数据库IP及端口配置文件在$GBASEDBTDIR/etc下,配置文件是以sqlhosts.开头的文件,后边跟实例名,每个实例会有一个配置文件
查看实例名称 onstat -g dis
[gbasedbt@shipeiarm-0005 ~]$ onstat -g dis
Your evaluation license will expire on 2024-09-26 00:00:00
On-Line -- Up 28 days 05:46:26 -- 1650688 Kbytes
There are 2 servers found
Server : gbase01
Server Number : 15
Server Type : IDS
Server Status : Up
Server Version: GBase Database Server Version 12.10.FC4G1TL
Shared Memory : 0x44000000
GBASEDBTDIR : /opt/gbase8s
ONCONFIG : /opt/gbase8s/etc/onconfig.gbase01
SQLHOSTS : /opt/gbase8s/etc/sqlhosts.gbase01
Host : shipeiarm-0005
对应的sqlhosts文件
[gbasedbt@shipeiarm-0005 ~]$ cat /opt/gbase8s/etc/sqlhosts.gbase01
gbase01 onsoctcp 172.168.10.109 9088第一列为实例名,第二列为使用的网络类型,onsoctcp表示动态socket连接,使用TCP协议,这两列基本上不用动,第三列为监听IP地址,如果需要本机所有IP都监听的话就配置为0.0.0.0,第四列是数据库服务监听端口,根据需要修改,选择不冲突的服务端口。
配置完成后,重启数据库实例生效(onmode -ky关闭实例,oninit -vy启动实例),重启后可以通过如下命令查看是否生效 onstat -g ntt
[gbasedbt@shipeiarm-0005 ~]$ onstat -g ntt
Your evaluation license will expire on 2024-09-26 00:00:00
On-Line -- Up 28 days 05:48:01 -- 1650688 Kbytes
global network information:
#netscb connects read write q-free q-limits q-exceed alloc/max
2/ 4 157 37821 273713 4/ 4 240/ 10 0/ 0 4/ 4
Individual thread network information (times):
netscb thread name sid open read write address
4908bbe0 soctcplst 3 09:15:29 14:28:43 172.168.10.109|9088|soctcp
05/28/24
4ab6e928 soctcppoll 2 09:16:53
05/28/24 或者可以使用操作系统命令查看监听情况
[gbasedbt@shipeiarm-0005 ~]$ netstat -ano | grep 9088
tcp 0 0 172.168.10.109:9088 0.0.0.0:* LISTEN off (0.00/0/0)热门帖子
- 12025-12-01浏览数:182763
- 22023-05-09浏览数:25057
- 42023-09-25浏览数:18525
- 52020-05-11浏览数:17528
onmode -P stop gbaseserver 在线停止监听服务;
onmode -P start gbaseserver 在线启动监听服务