快速搭建南大通用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技术社区,南大通用致力于成为用户最信赖的数据库产品供应商。

相关推荐
这个DBA有点耶2 天前
MVCC深入:Read View、版本链与快照读——InnoDB并发控制的内核
数据库·mysql·架构
DBA_G2 天前
从地面到云霄:GBase数据库在民航三大场景的落地实践
数据库
自由能燃气设备2 天前
商用全预混低氮冷凝锅炉免费方案vs付费方案对比+选型避坑指南
大数据·数据库·人工智能
科创致远2 天前
科创致远 ESOP 系统核心效能与实战价值展示
大数据·数据库·人工智能·精益工程
2601_962218612 天前
万象生鲜系统称重自动多退少补算法解决生鲜非标品痛点
大数据·数据库·人工智能·python·算法
张洛闻Eren2 天前
k8s云原生【第十课】:水平 Pod 自动扩缩容
运维·数据库·云原生·kubernetes·github
于平安2 天前
MySQL-触发器
数据库·mysql
白远山2 天前
上海24小时自助健身房解决方案实战指南与经验分享
java·数据库·架构·需求分析
Omics Pro2 天前
斯坦福Nature+Science|广义虚拟细胞基础大模型
数据库·人工智能·算法·机器学习·自然语言处理
2603_965148112 天前
AI+API选品:下一代智能商务助手雏形已现
java·大数据·数据库·人工智能·数据挖掘