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

相关推荐
TDengine (老段)1 天前
TDengine 整体架构全景 — 深度解析
大数据·数据库·物联网·架构·时序数据库·tdengine·涛思数据
Mahir081 天前
MySQL 事务全解:从 ACID 特性到并发问题,再到底层实现与线上最佳实践
数据库·mysql·面试
前进的李工1 天前
高效索引优化:数据库查询提速指南(适合创建索引的11种情况)
数据库·mysql·面试
l1t1 天前
DeepSeek总结的无需编译器:编写纯 SQL 的 Postgres 扩展
数据库·sql·postgresql
【心态好不摆烂】1 天前
MySQL数据类型
数据库·mysql
码云骑士1 天前
jwt入门介绍
linux·运维·数据库
努力努力再努力wz1 天前
【Redis 入门系列】为什么需要 Redis?一文串起缓存、分布式、读写分离、分库分表与微服务
数据库·redis·分布式·sql·mysql·缓存·微服务
得闲喝茶1 天前
SQL处理数据的常用语法语句
数据库·笔记·sql·数据分析·excel
金玉满堂@bj1 天前
PostgreSQL:企业级全能开源数据库
数据库·postgresql·开源
todoitbo1 天前
CTE 与外层 JOIN 的条件下推:原理、边界与验证方法
数据库·join·cte