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

相关推荐
数据库幼崽1 小时前
MySQL 8.0 OCP 1Z0-908 161-170题
数据库·mysql·ocp
数据库幼崽1 小时前
MySQL 8.0 OCP 1Z0-908 151-160题
数据库·mysql·ocp
消失在人海中1 小时前
Oracle资源管理器
数据库·oracle
文牧之1 小时前
Oracle RAC 中的 RBAL 进程
运维·数据库·oracle
zfj3216 小时前
H2数据库源码学习+debug, 数据库 sql、数据库引擎、数据库存储从此不再神秘
java·数据库·sql·学习·数据库底层原理
小赵面校招7 小时前
Redis企业级开发实战:核心应用场景与最佳实践
数据库·redis·缓存
pp-周子晗(努力赶上课程进度版)8 小时前
【MYSQL】基本查询,表的增删查改
数据库·mysql
英英_8 小时前
详细介绍一下Python连接MySQL数据库的完整步骤
数据库·python·mysql
LabVIEW开发9 小时前
LabVIEW数据库使用说明
数据库·sql·labview知识
Python智慧行囊9 小时前
Python Django 的 ORM 编程思想及使用步骤
数据库·python·django·orm