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

相关推荐
小蒜学长3 小时前
基于springboot 校园餐厅预约点餐微信小程序的设计与实现(代码+数据库+LW)
数据库·spring boot·微信小程序
kimble_xia@oracle3 小时前
Oracle打补丁笔记
数据库·oracle
鼠鼠我捏,要死了捏3 小时前
大规模系统中的分库分表原理深度解析与性能优化实践指南
数据库·性能优化·分库分表
Linux运维技术栈3 小时前
【实战+原理】微软云 Azure Database 私有网络接入模式全解析:从子网委派到Private Endpoint
数据库·microsoft·azure
小熊h4 小时前
MySQL集群高可用架构——组复制 (MGR)
linux·数据库·mysql
sunshine-sm5 小时前
CentOS Steam 9安装 MySQL 8
linux·运维·服务器·数据库·mysql·centos·centos stream
IT果果日记5 小时前
详解DataX开发达梦数据库插件
大数据·数据库·后端
烧冻鸡翅QAQ5 小时前
redis的数据类型:List
数据库·redis·list
蒋士峰DBA修行之路6 小时前
实验五 静态剪枝
数据库·算法·剪枝
蒋士峰DBA修行之路6 小时前
实验六 动态剪枝
数据库·算法·剪枝