目录
一、介绍
南大通用云数据仓库GBase Cloud Data Warehouse(简称 GCDW)是一款自主研发的基于列存储的海量分布式大规模并行处理的多实例弹性云数据仓库。GCDW既支持本地部署(私有云下的计算与存储分离模式)也支持云上部署,采用存算分离架构,支持计算资源和存储资源的无限独立扩展,适用于分析类型的大数据平台、综合性BI系统、数据仓库和集市系统。
二、环境信息
名称 | 值 |
CPU | Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz |
操作系统 | CentOS Linux release 7.9.2009 (Core) |
内存 | 4G |
逻辑核数 | 4 |
GCDW版本 | 9.8.0.6.17 |
集群节点1IP | 192.168.142.10 |
三、GCDW部署前提
在部署GCDW之前需要部署两款开源产品:
名称 | 描述 |
FoundationDb | 存储GCDW元数据。 |
MinIO | 存储GCDW用户数据。 |
1、FoundationDb部署
部署步骤请参考之前的博客《FoundationDB-学习-01-安装部署》
2、MinIO部署
部署步骤请参考之前的博客《对象存储-MinIO-学习-01-安装部署》
四、GCDW部署步骤
我这边就部署一个节点GCDW,原因有二:
1、电脑配置不高,已经开始发难了。
2、另一个节点安装了Gbase8a,可能会冲突。
1、FoundationDb客户端部署
所有GCDW节点都需要部署FoundationDb客户端,两个方法如下:
(1)可以直接用FoundationDb客户端的rpm包,记得修改fdb.cluster文件即可。
(2)参考三、GCDW部署前提 -> 1、FoundationDb部署。
如果大家是(2)安装的FoundationDb客户端,需用单独再装一次rpm包,因为GCDW安装程序会检索rpm是否安装,去掉检查也会有其他问题,本人深刻体会,按步骤来,一切相安无事。
[root@czg0 Release]# rpm -ivh foundationdb-clients-7.3.47-1.el7.x86_64.rpm
准备中... ################################# [100%]
正在升级/安装...
1:foundationdb-clients-7.3.47-1 ################################# [100%]
[root@czg0 Release]# cp /opt/GCDW/FoundationdDb/Config/fdb.cluster /etc/foundationdb/
2、创建用户和用户组
所有GCDW节点都需执行。
[root@czg0 opt]# groupadd gbase -g 2006
[root@czg0 opt]# useradd gbase -g 2006 -u 2006
[root@czg0 opt]# echo "gbase"|passwd --stdin gbase
3、创建目录
所有GCDW节点都需执行。
[root@czg0 GcdwPkg]# mkdir -p /opt/GCDW/Gcdw
4、设置目录权限
所有GCDW节点都需执行。
[root@czg0 GcdwPkg]# chown -R gbase:gbase /opt/GCDW/Gcdw
[root@czg0 GcdwPkg]# chmod -R 755 /opt/GCDW/Gcdw
5、解压安装包
一个节点执行即可。
[root@czg0 GcdwPkg]# tar -xvf GCDW-NoLicense-9.8.0.6.17_patch.1-redhat7-x86_64.tar.bz2
[root@czg0 GcdwPkg]# ll gcinstall/
总用量 294384
-rw-r--r-- 1 gbase gbase 393 6月 5 22:17 BUILDINFO
-rw-r--r-- 1 root root 2320530 6月 6 00:17 bundle_data.tar.bz2
-rw-r--r-- 1 root root 293399121 6月 6 00:20 bundle.tar.bz2
-rw-r--r-- 1 gbase gbase 1910 6月 5 22:14 CGConfigChecker.py
-rwxr-xr-x 1 gbase gbase 3673 6月 5 22:14 chkLicense
-rwxr-xr-x 1 gbase gbase 5213 6月 5 22:14 CorosyncConf.py
-rw-r--r-- 1 gbase gbase 814 6月 5 22:15 demo.options
-rw-r--r-- 1 root root 183 6月 6 00:17 dependRpms
drwxr-xr-x 4 gbase gbase 217 6月 5 22:15 docker
-rw-r--r-- 1 gbase gbase 684 6月 5 22:14 example.xml
-rwxr-xr-x 1 gbase gbase 358 6月 5 22:14 extendCfg.xml
-rw-r--r-- 1 gbase gbase 781 6月 5 22:14 FileCheck.py
-rw-r--r-- 1 gbase gbase 2540 6月 5 22:14 fulltext.py
-rw-r--r-- 1 gbase gbase 4818440 6月 5 22:14 gbase_data_timezone.sql
-rwxr-xr-x 1 gbase gbase 4264 6月 5 22:14 gccopy.py
-rwxr-xr-x 1 gbase gbase 4462 6月 5 22:14 gcexec.py
-rwxr-xr-x 1 gbase gbase 117177 6月 5 22:15 gcinstall.py
-rw-r--r-- 1 gbase gbase 294 6月 5 22:14 gcwareGroup.json
-rw-r--r-- 1 gbase gbase 232880 6月 5 22:15 InstallFuns.py
-rw-r--r-- 1 gbase gbase 135633 6月 5 22:15 InstallTar.py
-rw-r--r-- 1 gbase gbase 1113 6月 5 22:15 license.txt
-rwxr-xr-x 1 gbase gbase 75990 6月 5 22:14 pexpect.py
-rwxr-xr-x 1 gbase gbase 40460 6月 5 22:15 replace.py
-rwxr-xr-x 1 gbase gbase 24242 6月 5 22:14 replaceStop.py
-rw-r--r-- 1 gbase gbase 5273 6月 5 22:14 RestoreLocal.py
-rwxr-xr-x 1 gbase gbase 18930 6月 5 22:14 Restore.py
-rw-r--r-- 1 gbase gbase 8772 6月 5 22:14 rmt.py
-rw-r--r-- 1 gbase gbase 299 6月 5 22:14 rootPwd.json
-rwxr-xr-x 1 gbase gbase 29901 6月 5 22:14 SetSysEnv.py
-rw-r--r-- 1 gbase gbase 2615 6月 5 22:14 SSHThread.py
-rwxr-xr-x 1 gbase gbase 6951 6月 5 22:14 unInstall_fulltext.py
-rwxr-xr-x 1 gbase gbase 35686 6月 5 22:15 unInstall.py
-rw-r--r-- 1 gbase gbase 72301 6月 5 22:14 UpdateSysTable.json
6、配置环境变量
所有GCDW节点都需执行。
[root@czg0 GcdwPkg]# cd gcinstall/
[root@czg0 gcinstall]# ./SetSysEnv.py --help
Usage: SetSysEnv.py [options]
Options:
-h, --help show this help message and exit
-c, --cgroup resource management: control groups config,default: no
configuration
--installPrefix=INSTALLPREFIX
installation directory for cluster logs which are
archived on schedule
--dbaUser=DBAUSER dba user
[root@czg0 gcinstall]# ./SetSysEnv.py --installPrefix=/opt/GCDW/Gcdw --dbaUser=gbase
7、配置demo.options
一个节点执行即可。
[root@czg0 gcinstall]# cat demo.options
installPrefix= /opt/GCDW/Gcdw
coordinateHost = 192.168.142.10
#coordinateHostNodeID = 234,235,237
dataHost = 192.168.142.10
#existCoordinateHost =
#existDataHost =
#existGcwareHost=
gcwareHost = 192.168.142.10
#gcwareHostNodeID = 234,235,237
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'gbase'
gcluster_instance_name=gcdw
instance_root_name=root
instance_root_password=qwer1234
rootPwd = 'qwer1234'
account_admin_password=Gcdw@2024
#rootPwdFile = rootPwd.json
#characterSet = utf8
#dbPort = 5258
#sshPort = 22
# 's3' or 'hdfs'
GCDW_STORAGE_STYLE=s3
GCDW_S3_BUCKET=zxj.bucket
GCDW_S3_ENDPOINT=192.168.142.10:9000
GCDW_S3_ACCESS_KEY_ID=minioadmin
GCDW_S3_SECRET_KEY=minioadmin
GCDW_S3_REGION=''
#GCDW_HDFS_NAMENODES=192.168.151.100:50070,192.168.151.101:50070
#GCDW_HDFS_URI=hdp://gbase@192.168.151.100:50070/
参数名 | 描述 |
installPrefix | 安装目录 |
coordinateHost | 集群调度节点 IP 列表 |
coordinateHostNodeID | 每个 Coordinator 节点的 nodeid,在 IPV6 和域名安装时,必须指定,IPV4 安装时可不指定,与coordinateHost 中列出的节点列表一一对应,之间用“,”分隔; |
dataHost | 集群数据节点 IP 列表 |
existCoordinateHost | 已存在集群调度节点 IP 列表 |
existDataHost | 已存在集群数据节点 IP 列表 |
existGcwareHost | 已存在Gcware 节点 IP 列表 |
gcwareHost | Gcware 节点 IP 列表 |
gcwareHostNodeID | 每个 gcware 节点的 nodeid,在 IPV6 和域名安装时,必须指定,IPV4 安装时可不指定,与gcwareHost 中列出的节点列表一一对应,之间用“,”分隔; |
dbaUser | 集群操作系统用户名 |
dbaGroup | 集群操作系统用户组 |
dbaPwd | 集群操作系统用户密码 |
gcluster_instance_name | GCDW 实例的名字,可由用户进行命名,即租户名。 |
instance_root_name | 实例管理员用户名,即租户的根用户名。 |
instance_root_password | 实例管理员的密码,即根用户密码。 |
rootPwd | 操作系统 root 用户的密码。已弃用。 |
account_admin_password | 未知。 |
rootPwdFile | root用户密码各个服务器不一致时,使用的密码文件。 |
characterSet | 系统支持指定字符集安装。 |
dbPort | 数据库端口,默认为 5258。 |
sshPort | sshd 服务端口号。 |
GCDW_STORAGE_STYLE | GCDW存储用户数据的数据库类型,'s3' or 'hdfs' 。 |
GCDW_S3_BUCKET | 对象存储的桶名。 |
GCDW_S3_ENDPOINT | 对象存储的终端地址,也就是登录web页面的地址。 |
GCDW_S3_ACCESS_KEY_ID | 对象存储的用户名。 |
GCDW_S3_SECRET_KEY | 对象存储的用户名密码。 |
GCDW_S3_REGION | 所处的区域。可以直接置空''。 |
GCDW_HDFS_NAMENODES | 没有用过,不知道格式,后续补充。 |
GCDW_HDFS_URI | 没有用过,不知道格式,后续补充。 |
8、安装
一个节点执行即可。大家不要学我,用gbase用户执行此命令。
[root@czg0 gcinstall]# ./gcinstall.py --silent demo.options
192.168.142.10 install gcware and cluster on host 192.168.142.10 successfully.
192.168.142.10 install gcware and cluster on host 192.168.142.10 successfully.
init account to foundationdb successfully
adding user and nodes message to foundationdb
adding user and nodes message to foundationdb successfully
Starting all gcluster nodes ...
adding new datanodes to gcware ...
9、查看集群各节点信息
[gbase@czg0 ~]$ gcadmin
CLUSTER STATE: ACTIVE
======================================
| GBASE GCWARE CLUSTER INFORMATION |
======================================
| NodeName | IpAddress | gcware |
--------------------------------------
| gcware1 | 192.168.142.10 | OPEN |
--------------------------------------
========================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
========================================================
| NodeName | IpAddress | gcluster | DataState |
--------------------------------------------------------
| coordinator1 | 192.168.142.10 | OPEN | 0 |
--------------------------------------------------------
==================================================
| GBASE CLUSTER FREE DATA NODE INFORMATION |
==================================================
| NodeName | IpAddress | gnode | DataState |
--------------------------------------------------
| FreeNode1 | 192.168.142.10 | OPEN | 0 |
--------------------------------------------------
0 warehouse
1 coordinator node
1 free data node
10、查看租户信息
[gbase@czg0 ~]$ account --show
account:
*************************** 1. row ***************************
accountname :gcdw
company :
mobile :
email :
nickname :
disabled :N
coor_addr :192.168.142.10
storage_style :s3
s3_accessKey :minioadmin
s3_secretKey :minioadmin
s3_endPoint :192.168.142.10:9000
s3_region :
s3_bucket :zxj.bucket
comment :
hdfs_namenodes :None
hdfs_uri :None
schedule_type :
1 rows in set
SUCCESS
11、生成Warehouse配置模板
[gbase@czg0 gcinstall]$ gcadmin createwh e WarehouseCzg.xml
12、调整Warehouse配置
[gbase@czg0 gcinstall]$ cat WarehouseCzg.xml
<?xml version='1.0' encoding="utf-8"?>
<servers>
<rack>
<node ip="192.168.142.10"/>
</rack>
<wh_name name="WarehouseCzg"/>
<comment message="Czg"/>
</servers>
13、生成Warehouse
[gbase@czg0 gcinstall]$ gcadmin createwh WarehouseCzg.xml
parse config file WarehouseCzg.xml
generate wh id: wh00001
add wh information to cluster
add nodes to wh
create gclusterdb.dual successful
gcadmin create wh [WarehouseCzg] successful
14、查看集群各节点信息
出现Warehouse相关信息
[gbase@czg0 gcinstall]$ gcadmin
CLUSTER STATE: ACTIVE
======================================
| GBASE GCWARE CLUSTER INFORMATION |
======================================
| NodeName | IpAddress | gcware |
--------------------------------------
| gcware1 | 192.168.142.10 | OPEN |
--------------------------------------
========================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
========================================================
| NodeName | IpAddress | gcluster | DataState |
--------------------------------------------------------
| coordinator1 | 192.168.142.10 | OPEN | 0 |
--------------------------------------------------------
============================
| GBASE WAREHOUSE INFORMAT |
============================
| WhName | comment |
----------------------------
| warehouseczg | Czg |
----------------------------
1 warehouse: warehouseczg
1 coordinator node
0 free data node
15、查看Warehouse具体信息
[gbase@czg0 gcinstall]$ gcadmin showcluster wh warehouseczg
CLUSTER STATE: ACTIVE
============================
| GBASE WAREHOUSE INFORMAT |
============================
| WhName | comment |
----------------------------
| warehouseczg | Czg |
----------------------------
===============================================================
| WAREHOUSE DATA NODE INFORMATION |
===============================================================
| NodeName | IpAddress | gnode |
---------------------------------------------------------------
| node1 | 192.168.142.10 | OPEN |
---------------------------------------------------------------
1 data node
16、gccli登录测试
[gbase@czg0 gcinstall]$ gccli -uroot -pqwer1234 -h192.168.142.10
GBase client 9.8.0.6.17_patch.19971bae. Copyright (c) 2004-2024, GBase. All Rights Reserved.
gbase> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| performance_schema |
| cloud |
| gclusterdb |
| gctmpdb |
+--------------------+
5 rows in set (Elapsed: 00:00:00.16)
gbase> CREATE DATABASE CZG;
Query OK, 1 row affected (Elapsed: 00:00:00.26)
gbase> USE CZG;
Query OK, 0 rows affected (Elapsed: 00:00:00.05)
gbase> CREATE TABLE CZG.CZG (A INT);
Query OK, 0 rows affected (Elapsed: 00:00:00.38)
17、设置用户默认Warehouse
gbase> alter user root default_warehouse='warehouseczg';
Query OK, 0 rows affected (Elapsed: 00:00:00.13)
五、GCDW集群启动和停止
每个节点上都要执行哦
1、停止
[gbase@czg0 gcinstall]$ gcluster_services all stop
Stopping gcluster : [ OK ]
Stopping gbase : [ OK ]
Stopping syncserver : [ OK ]
[gbase@czg0 gcinstall]$ gcware_services all stop
Stopping GCWareMonit success!
Stopping gcware : [ OK ]
2、启动
[gbase@czg0 gcinstall]$ gcluster_services all start
Starting gbase : [ OK ]
Starting syncserver : [ OK ]
Starting gcluster : [ OK ]
[gbase@czg0 gcinstall]$ gcware_services all start
Starting gcware : [ OK ]
Starting GCWareMonit success!
六、GCDW后台集群节点服务监控
gcmonit 监控 GCDW 集群节点的状态。 当服务关闭时拉起该服务。
[gbase@czg0 gcinstall]$ cd /opt/GCDW/Gcdw/192.168.142.10/gcluster/server/bin/
gcmonit.sh关闭命令需在bin目录下执行,官方提示。
1、监控状态
[gbase@czg0 bin]$ ./gcmonit.sh status
+-----------------------------------------------------------------------------------------------------------------------------------+
|SEG_NAME PROG_NAME STATUS PID |
+-----------------------------------------------------------------------------------------------------------------------------------+
|gcluster gclusterd Running 24552 |
|gbase_192.168.142.10 /opt/GCDW/Gcdw/192.168.142.10/gnode/server/bin/gbased Running 24519 |
|syncserver_192.168.142.10 /opt/GCDW/Gcdw/192.168.142.10/gnode/server/bin/gc_sync_server Running 24528 |
|gcmmonit gcmmonit Running 24547 |
+-----------------------------------------------------------------------------------------------------------------------------------+
2、监控启动
[gbase@czg0 bin]$ ./gcmonit.sh start
Starting GCMonit success!
3、监控停止
[gbase@czg0 bin]$ ./gcmonit.sh stop
Stopping GCMonit success!