快速搭建南大通用GBase 8s数据库SSC共享存储集群

原文链接:www.gbase.cn/community/p...

更多精彩内容尽在南大通用GBase技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。

你好!读者朋友们,你是否在寻找一种简便的方法来验证共享存储集群的功能?本文将为你提供集群搭建指南并帮助你快速进行功能验证,让我们来一起探索如何在单机环境中快速部署SSC共享存储集群。

【准备工作】

  • 准备数据库安装包:

从GBase官网获取即可根据需要的架构自行下载,网址如下:

www.gbase.cn/download/gb...

  • 准备测试机(虚拟机和实体机器均可)

【操作步骤】

1、安装数据库

使用非实例化安装(执行ids_install后选择不创建实例)或静默安装均可。

注意:静默安装之前需要将gbasedbt用户提前创建好,推荐命令如下:

shell 复制代码
# useradd -m -U gbasedbt
# 静默安装命令如下
# 使用tar -xvf解压下载的数据库安装包
# ./ids_install -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR={install_path} #{install_path} 为想要安装数据库的路径,本文中的安装路径为/data/ssc

2、创建环境变量文件

准备两个环境变量文件。

我们假设数据库实例1的实例名为Server1,实例2的实例名为Server2,配置文件内容如下:

实例1:

ruby 复制代码
# touch /data/ssc/profile.server1
 # Vi  /data/ssc/profile.server1
export GBASEDBTDIR=/data/ssc
export ONCONFIG=onconfig.server1
export GBASEDBTSQLHOSTS=/data/ssc/etc/sqlhosts.server1
export GBASEDBTSERVER=server1
export PATH=/data/ssc/bin:/data/ssc/sbin:/data/ssc/extend/krakatoa/jre/bin:$PATH

实例2:

ruby 复制代码
# touch /data/ssc/profile.server2
 # Vi  /data/ssc/profile.server2
export GBASEDBTDIR=/data/ssc
export ONCONFIG=onconfig.server2
export GBASEDBTSQLHOSTS=/data/ssc/etc/sqlhosts.server2
export GBASEDBTSERVER=server2
export PATH=/data/ssc/bin:/data/ssc/sbin:/data/ssc/extend/krakatoa/jre/bin:$PATH

3、准备实例1和实例2的数据存储目录和rootdbs文件

shell 复制代码
# mkdir -p /data/ssc/storage
# chown gbasedbt:gbasedbt /data/ssc/storage
# chmod 755 /data/ssc/storage
# cd /data/ssc/storage
# touch rootdbs
# chown   gbasedbt:gbasedbt rootdbs
# chmod 660 rootdbs

4、修改sqlhost

ini 复制代码
touch /data/ssc/etc/sqlhosts.server1
vi /data/ssc/etc/sqlhosts.server1
g_cluster_1     group    -       -       i=1
server1     onsoctcp        localhost    50000    g=g_cluster_1
server2     onsoctcp        localhost    50001    g=g_cluster_1

server2 的sqlhosts与server1一致即可

bash 复制代码
cp /data/ssc/etc/sqlhosts.server1 /data/ssc/etc/sqlhosts.server2

5、onconfig设置

bash 复制代码
修改onconfig配置文件中与SSC集群配置相关项
# cd /data/ssc/etc
# cp onconfig.std onconfig.server1
# cp onconfig.std onconfig.server2
# vi onconfig.server1
ROOTPATH rootdbs
LTAPEDEV /dev/null
# 主节点:
DBSERVERNAME server1
SERVERNUM 130
# 从节点:
DBSERVERNAME server2
SERVERNUM 131
# 主节点设置如下(/data/ssc/tmp1文件夹需要提前创建)
SDS_TEMPDBS sdstmpdbs1, /data/ssc/tmp1/sdstmpdbs1,2,0,16000
SDS_PAGING /data/ssc/tmp1/sdstmp1,/data/ssc/tmp1/sdstmp12
# 从节点设置如下(/data/ssc/tmp2文件夹需要提前创建)
SDS_TEMPDBS sdstmpdbs1, /data/ssc/tmp2/sdstmpdbs1,2,0,16000
SDS_PAGING /data/ssc/tmp2/sdstmp1,/data/ssc/tmp2/sdstmp12

# 主节点
SDS_ENABLE
# 从节点
SDS_ENABLE 1

6、搭建sds集群

主节点执行命令如下:

shell 复制代码
# source /data/ssc/profile.server1
# cd /data/ssc/storage
# oninit -ivwy
# onmode -d set SDS primary server1

从节点执行命令如下:

shell 复制代码
# source /data/ssc/profile.server2
# cd /data/ssc/storage
# oninit -vwy

7、集群检查

bash 复制代码
# 主节点执行命令如下:如果结果显示如下则表示搭建成功。
[root@bogon storage]# onstat -g sds
Your evaluation license will expire on 2025-10-21 00:00:00
On-Line -- Up 00:00:59 -- 156976 Kbytes

Local server type: Primary
Number of SDS servers:1

SDS server information

SDS srv      SDS srv      Connection        Last LPG sent        Supports
name         status       status            (log id,page)        Proxy Writes
server2      Active       Connected               6,2872         N

按照上述步骤,你已经成功搭建了一个SSC共享存储集群。希望这篇文章能够帮助你更好地理解和运用共享存储集群技术。如果你有任何疑问或需要进一步的帮助,请随时联系我们。感谢你的阅读,期待你的实践成果!

原文链接:www.gbase.cn/community/p...

更多精彩内容尽在南大通用GBase技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。

相关推荐
Gobysec14 小时前
Goby 漏洞安全通告|MindsDB /api/sql/query 未授权访问漏洞(CVE-2025-68472)
数据库·sql·安全
m0_7482459214 小时前
SQLite 数据类型概述
java·数据库·sqlite
五阿哥永琪14 小时前
MySQL 回表查询 性能代价?如何避免?
数据库·mysql
DBA小马哥14 小时前
文档型数据库MongoDB迁移替换至金仓数据库上线流程周期全解析
数据库·mongodb·文档型数据库
冰暮流星14 小时前
sql语言之where语句
java·数据库·sql
橘子1314 小时前
MySQL基础(一)
数据库·mysql·php
難釋懷14 小时前
安装Redis
数据库·redis·缓存
jiayong2314 小时前
Word协作与审阅实用手册
服务器·数据库·word
涵涵(互关)14 小时前
添加了 @TableId(type = IdType.AUTO) 但仍生成超大 ID
数据库·spring·mybatis
什么都不会的Tristan14 小时前
redis-原理篇-SDS
数据库·redis·缓存