Hello, readers! GBase 8s is one of the few mature databases with advanced SSC (Shared Storage Cluster) functionality. Are you looking for a simple way to validate the features of a shared storage cluster? This article will provide a guide to setting up a cluster and quickly verifying functionality. Let’s dive into deploying an SSC shared storage cluster in a single-machine environment.
Preparation
1. Prepare the Database Installation Package:
Download the package from the GBase official website according to your architecture requirements:
https://www.gbase.cn/download/gbase-8s-1?category=INSTALL_PACKAGE
2. Prepare Test Machines (VM or Physical Machines):
Steps
1. Install the Database
Use a non-instantiated installation (select the option not to create an instance after running ids_install
) or silent installation.
Note: For silent installation, ensure the gbasedbt
user is created beforehand with the following command:
# useradd -m -U gbasedbt
For silent installation, extract the database installation package with tar -xvf
and then execute:
# ./ids_install -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR={install_path} # Replace {install_path} with the desired installation path, such as /data/ssc
2. Create Environment Variable Files
Prepare two environment variable files.
Assume the instance names are Server1
for database instance 1 and Server2
for instance 2. Here’s the configuration:
For Instance 1:
# 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
For Instance 2:
# 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. Prepare Data Storage Directories and rootdbs
File for Instances 1 and 2
# 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. Modify sqlhosts
# 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
The sqlhosts
file for server2
should match server1
:
# cp /data/ssc/etc/sqlhosts.server1 /data/ssc/etc/sqlhosts.server2
5. Configure onconfig
Update onconfig
files with SSC cluster settings.
# cd /data/ssc/etc # cp onconfig.std onconfig.server1 # cp onconfig.std onconfig.server2
For Primary Node (server1):
ROOTPATH rootdbs LTAPEDEV /dev/null DBSERVERNAME server1 SERVERNUM 130 SDS_TEMPDBS sdstmpdbs1, /data/ssc/tmp1/sdstmpdbs1,2,0,16000 SDS_PAGING /data/ssc/tmp1/sdstmp1,/data/ssc/tmp1/sdstmp12 SDS_ENABLE
For Secondary Node (server2):
ROOTPATH rootdbs LTAPEDEV /dev/null DBSERVERNAME server2 SERVERNUM 131 SDS_TEMPDBS sdstmpdbs1, /data/ssc/tmp2/sdstmpdbs1,2,0,16000 SDS_PAGING /data/ssc/tmp2/sdstmp1,/data/ssc/tmp2/sdstmp12 SDS_ENABLE 1
Note: Ensure /data/ssc/tmp1
and /data/ssc/tmp2
directories are created beforehand.
6. Set Up SDS Cluster
On the primary node, run:
# source /data/ssc/profile.server1 # cd /data/ssc/storage # oninit -ivwy # onmode -d set SDS primary server1
On the secondary node, run:
# source /data/ssc/profile.server2 # cd /data/ssc/storage # oninit -vwy
7. Verify Cluster Setup
To verify, run the following on the primary node. The successful output should resemble the below:
# 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
Following these steps, you have successfully set up an SSC shared storage cluster. We hope this guide has helped you better understand and utilize shared storage cluster technology. If you have any questions or need further assistance about GBase database (GBase数据库), feel free to reach out. Thank you for reading, and we look forward to seeing the results of your implementation!
Top comments (0)