概述

GBase 8a MPP Cluster 支持集群扩容、集群缩容、集群节点替换等功能,满足在集群运行过程中需要存储的数据增加导致数据存储空间不足,长时间运行导致单节点硬件故障,整体集群需要进行硬件升级等场景。
V9.5.3 当前不支持 gcware 节点的扩容和缩容,支持 gcware 节点替换。

集群扩容操作流程-多VC模式

       扩容纯 data 节点 :

集群环境描述:
       Coordinator 节点: 172.168.83.11, 172.168.83.12, 172.168.83.13
       Data 节点:
       vc1: 172.168.83.11, 172.168.83.12
       Vc2: 172.168.83.13, 172.168.83.14
       待扩容到 vc1 的 data 节点 IP:172.168.83.15

       安装节点(可选)  

如果当前已经存在 freenode 节点,可以忽略该步骤。

步骤 1:修改 demo.options 文件:
       1) 设置 dataHost 参数为要安装的节点的 IP;
       2) 修改 existCoordinateHost 参数为已存在的 Coordinator 节点的 IP;
       3) 修改 existDataHost 参数为已存在的所有 data 节点的 IP。
       修改后的 demo.options 参考如下:

$ cat demo.options
installPrefix= /opt
#coordinateHost =
#coordinateHostNodeID =1,2,3
dataHost = 172.168.83.15
existCoordinateHost =172.168.83.11,172.168.83.12,172.168.83.13
existDataHost
=172.168.83.11,172.168.83.12,172.168.83.13,172.168.83.14
existGcwareHost=172.168.83.11,172.168.83.12,172.168.83.13
#gcwareHost =
#gcwareHostNodeID =
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'gbasedba'
rootPwd = '111111' #rootPwdFile = rootPwd.json

步骤 2:执行安装

$ ./gcinstall.py --silent=demo.options
******************************************************************
***************
Thank you for choosing GBase product!
………………
******************************************************************
Do you accept the above licence agreement ([Y,y]/[N,n])? y
******************************************************************
Welcome to install GBase products
******************************************************************
Environmental Checking on gcluster nodes.
CoordinateHost:
DataHost:
172.168.83.15 Are you sure to install GCluster on these nodes ([Y,y]/[N,n])? y
………………
172.168.83.15 install cluster on host 172.168.83.15
successfully.
update and sync configuration file...
Starting all gcluster nodes...
adding new datanodes to gcware...
$
##出现上面信息表示安装成功
安装后状态信息如下:
$ gcadmin
CLUSTER STATE: ACTIVE
================================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
================================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
----------------------------------------------------------------
| coordinator1 | 172.168.83.11 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator2 | 172.168.83.12 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator3 | 172.168.83.13 | OPEN | OPEN | 0 |
----------------------------------------------------------------
===============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
===============================================
| VcName | DistributionId | comment |
-----------------------------------------------
| vc1 | 1 | vc1comments |
-----------------------------------------------
| vc2 | 2 | vc2comments |
-----------------------------------------------
==============================================================
| GBASE CLUSTER FREE DATA NODE INFORMATION |
==============================================================
| NodeName | IpAddress | gnode | syncserver | DataState |
--------------------------------------------------------------
| FreeNode1 | 172.168.83.15 | OPEN | OPEN | 0 |
--------------------------------------------------------------
2 virtual cluster: vc1, vc2
3 coordinator node
1 free data node

       将节点添加到待扩容 vc  

需要使用 addnodes 命令将 freenode 节点添加到要扩容的 VC 中,然后才可以进行下一步操作。

步骤 1:修改 gcChangeInfo.xml 文件:

$ cat gcChangeInfo.xml
<?xml version="1.0" encoding="utf-8"?>
<servers>
<rack>
<node ip="172.168.83.15"/>
</rack>
</servers>

步骤 2:将 freenode 添加到 vc1 中:

$ gcadmin addnodes gcChangeInfo.xml vc1
gcadmin add nodes ...
flush statemachine success
gcadmin addnodes to vc [vc1] success
添加后,集群状态信息如下:
$ gcadmin
CLUSTER STATE: ACTIVE
================================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
================================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
----------------------------------------------------------------
| coordinator1 | 172.168.83.11 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator2 | 172.168.83.12 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator3 | 172.168.83.13 | OPEN | OPEN | 0 |
----------------------------------------------------------------
===============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
===============================================
| VcName | DistributionId | comment |
-----------------------------------------------
| vc1 | 1 | vc1comments |
-----------------------------------------------
| vc2 | 2 | vc2comments |
-----------------------------------------------
2 virtual cluster: vc1, vc2
3 coordinator node
0 free data node
$ gcadmin showcluster vc vc1
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
===============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
===============================================
| VcName | DistributionId | comment |
-----------------------------------------------
| vc1 | 1 | vc1comments |
-----------------------------------------------
================================================================================
| VIRTUAL CLUSTER DATA NODE INFORMATION |
================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
--------------------------------------------------------------------------------
| node1 |172.168.83.11 | 1 | OPEN | OPEN | 0 |
--------------------------------------------------------------------------------
| node2 |172.168.83.12 | 1 | OPEN | OPEN | 0 |
--------------------------------------------------------------------------------
| node3 |172.168.83.15 | | OPEN | OPEN | 0 |
3 data node

       创建新的 distribution

步骤 1:修改安装目录下的 gcChangeInfo.xml 文件,增加待扩容的节点 IP,即将扩容后的所有节点 IP 都写入 gcChangeInfo.xml 文件。
       修改后的 gcChangeInfo.xml 文件参考如下:

$ cat gcChangeInfo.xml
<?xml version="1.0" encoding="utf-8"?>
<servers>
<rack>
<node ip="172.168.83.15"/>
<node ip="172.168.83.11"/>
<node ip="172.168.83.12"/>
</rack>
</servers>

步骤 2:执行创建 distribution 的命令。

$ gcadmin distribution gcChangeInfo.xml p 1 d 1 vc vc1
gcadmin generate distribution ...
copy system table to 172.168.83.15
gcadmin generate distribution successful
完成后的集群信息如下:
$ gcadmin showdistribution vc vc1
Distribution ID: 3 | State: new | Total segment num: 3
Primary Segment Node IP Segment ID Duplicate Segment node IP
=========================================================================
| 172.168.83.15 | 1 | 172.168.83.11 |
-------------------------------------------------------------------------
| 172.168.83.11 | 2 | 172.168.83.12 |
-------------------------------------------------------------------------
| 172.168.83.12 | 3 | 172.168.83.15 |
=========================================================================
Distribution ID: 1 | State: old | Total segment num: 2
Primary Segment Node IP Segment ID Duplicate Segment node IP
=========================================================================
| 172.168.83.11 | 1 | 172.168.83.12 |
-------------------------------------------------------------------------
| 172.168.83.12 | 2 | 172.168.83.11 |
=========================================================================

       初始化 hashmap 并进行数据重分布  
       在该步骤中可以设置 rebalance 任务的优先级。先设置参数gcluster_rebalancing_concurrent_count=0 阻止 rebalance 任务被执行。然后利用rebalance instance 把当前集群下所有表加入到gclusterdb.rebalancing_status 中。调整完每个表的 rebalance 任务的优先级后再设置 gcluster_rebalancing_concurrent_count为需要的并发数,开始执行数据重分布。详细步骤参考章节调整 rebalance 任务优先级。

步骤 1:初始化 hashmap:

$ gccli -uroot
GBase client 9.5.3.17.117651. Copyright (c) 2004-2020, GBase. All
Rights Reserved.
gbase> use vc vc1;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)
gbase> initnodedatamap;
Query OK, 0 rows affected, 5 warnings (Elapsed: 00:00:01.45)

步骤 2:执行数据重分布,本示例中没有进行优先级调整:

gbase> show variables like '%rebalanc%';

+-------------------------------------------------------+-----------+
| Variable_name | Value |
+-------------------------------------------------------+-----------+
| _t_gcluster_rebalance_mirror_node | 0 |
| gcluster_load_rebalance_seed | 5 |
| gcluster_rebalancing_concurrent_count | 5 |
| gcluster_rebalancing_ignore_mirror | OFF |
| gcluster_rebalancing_immediate_recover_internal_table | OFF |
| gcluster_rebalancing_parallel_degree | 4 |
| gcluster_rebalancing_random_table_quick_mode | 1 |
| gcluster_rebalancing_step | 100000000 |
| gcluster_rebalancing_update_status_on_drop_table | ON |
+-------------------------------------------------------+-----------+
9 rows in set (Elapsed: 00:00:00.24)
gbase> rebalance instance;
Query OK, 2 rows affected (Elapsed: 00:00:01.45)
gbase> show variables like '%rebalanc%';
+-------------------------------------------------------+-----------+
| Variable_name | Value |
+-------------------------------------------------------+-----------+
| _t_gcluster_rebalance_mirror_node | 0 |
| gcluster_load_rebalance_seed | 5 |
| gcluster_rebalancing_concurrent_count | 5 |
| gcluster_rebalancing_ignore_mirror | OFF |
| gcluster_rebalancing_immediate_recover_internal_table | OFF |
| gcluster_rebalancing_parallel_degree | 4 |
| gcluster_rebalancing_random_table_quick_mode | 1 |
| gcluster_rebalancing_step | 100000000 |
| gcluster_rebalancing_update_status_on_drop_table | ON |
+-------------------------------------------------------+-----------+
9 rows in set (Elapsed: 00:00:00.24)
gbase> rebalance instance;
Query OK, 2 rows affected (Elapsed: 00:00:01.45)
查看 rebalance 状态:
gbase> select index_name, status, percentage from
gclusterdb.rebalancing_status;
+------------+-----------+------------+
| index_name | status | percentage |
+------------+-----------+------------+
| demo.t | COMPLETED | 100 |
| demo.tt | COMPLETED | 100 |
+------------+-----------+------------+
2 rows in set (Elapsed: 00:00:00.04)
gbase> quit
Bye

       删除旧的 distribution  

步骤 1:确认当前的 distribution id,在当前示例中新的 Distribution ID 为 3,旧的Distribution ID 为 1:

$ gcadmin showdistribution vc vc1
Distribution ID: 3 | State: new | Total segment num: 3
Primary Segment Node IP Segment ID Duplicate Segment node IP
=========================================================================
| 172.168.83.15 | 1 | 172.168.83.11 |
-------------------------------------------------------------------------
| 172.168.83.11 | 2 | 172.168.83.12 |
-------------------------------------------------------------------------
| 172.168.83.12 | 3 | 172.168.83.15 |
=========================================================================
Distribution ID: 1 | State: old | Total segment num: 2
Primary Segment Node IP Segment ID Duplicate Segment node IP
=========================================================================
| 172.168.83.11 | 1 | 172.168.83.12 |
-------------------------------------------------------------------------
| 172.168.83.12 | 2 | 172.168.83.11 |
=========================================================================

步骤 2:确认当前集群中没有使用旧的 Distribution ID 的表

gbase> select index_name,tbname,data_distribution_id,vc_id from
gbase.table_distribution;
+------------------------------+------------------+---------------------+---------+
| index_name |tbname |data_distribution_id | vc_id |
+------------------------------+------------------+---------------------+---------+
| gclusterdb.rebalancing_status|rebalancing_status| 3 | vc00001 |
| gclusterdb.dual |dual | 3 | vc00001 |
| demo.t |t | 3 | vc00001 |
| demo.tt |tt | 3 | vc00001 |
+------------------------------+------------------+---------------------+---------+

步骤 3:删除旧的 distribution

$ gcadmin rmdistribution 1 vc vc1
cluster distribution ID [1]
it will be removed now
please ensure this is ok, input [Y,y] or [N,n]: y
select count(*) from gbase.nodedatamap where data_distribution_id=1 result is not 0
refreshnodedatamap drop 1 success
gcadmin remove distribution [1] success
$ gcadmin showdistribution vc vc1
Distribution ID: 3 | State: new | Total segment num: 3
Primary Segment Node IP Segment ID Duplicate Segment node IP
===================================================================================
| 172.168.83.15 | 1 | 172.168.83.11 |
-----------------------------------------------------------------------------------
| 172.168.83.11 | 2 | 172.168.83.12 |
-----------------------------------------------------------------------------------
| 172.168.83.12 | 3 | 172.168.83.15 |
===================================================================================

       扩容纯 coordinator 节点     

集群环境描述:
       Coordinator 节点: 172.168.83.11, 172.168.83.12, 172.168.83.13
       Data 节点:
       vc1: 172.168.83.11, 172.168.83.12
       Vc2: 172.168.83.13, 172.168.83.14
       增加新的 coordinator 节点 IP:172.168.83.15

准备配置文件

步骤 1:修改 demo.options 文件:
       1) 设置 coordinateHost 参数为要安装的节点的 IP;

2) 设置 coordinateHostNodeID 参数为要安装的节点设置的 ID,与 coordinateHost节点设置的一一对应,且不重复的整数值;

3) 修改 existCoordinateHost 参数为已存在的 Coordinator 节点的 IP;
       4) 修改 existDataHost 参数为已存在的所有 data 节点的 IP。
       修改后的 demo.options 参考如下:

  $ cat demo.optionsinstallPrefix= /optcoordinateHost = 172.168.83.15
coordinateHostNodeID =15
#dataHost = 172.168.83.15
existCoordinateHost =172.168.83.11,172.168.83.12,172.168.83.13
existDataHost
=172.168.83.11,172.168.83.12,172.168.83.13,172.168.83.14
existGcwareHost=172.168.83.11,172.168.83.12,172.168.83.13
#gcwareHost =
#gcwareHostNodeID =
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'gbasedba'
rootPwd = '111111'
#rootPwdFile = rootPwd.json

       停止所有节点的集群服务  

步骤 1 在所有节点执行集群服务停止命令

$ gcluster_services all stop
Stopping gcrecover : [ OK ]
Stopping gcluster : [ OK ]
Stopping gbase : [ OK ]
Stopping syncserver : [ OK ]
$ gcware_services all stop
Stopping GCWareMonit success!
Stopping gcware : [ OK ]

       安装节点  

步骤 1:执行安装

$ ./gcinstall.py --silent=demo.options --timeout=120
*********************************************************************************
Thank you for choosing GBase product!
………………
******************************************************************
Do you accept the above licence agreement ([Y,y]/[N,n])? y
******************************************************************
Welcome to install GBase products
******************************************************************
Environmental Checking on gcluster nodes.
CoordinateHost:
DataHost:
172.168.83.15
Are you sure to install GCluster on these nodes ([Y,y]/[N,n])? y
………………
172.168.83.11 install cluster on host 172.168.83.11 successfully.
172.168.83.12 install cluster on host 172.168.83.12 successfully.
172.168.83.13 install cluster on host 172.168.83.13 successfully.
172.168.83.15 install cluster on host 172.168.83.15 successfully.
update and sync configuration file...
Starting all gcluster nodes...
sync coordinator system tables...
$ ##出现上面信息表示安装成功
       安装后状态信息如下:
$ gcadmin
CLUSTER STATE: ACTIVE
================================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
================================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
----------------------------------------------------------------
| coordinator1 | 172.168.83.11 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator2 | 172.168.83.12 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator3 | 172.168.83.13 | OPEN | OPEN | 0 |
----------------------------------------------------------------
| coordinator4 | 172.168.83.15 | OPEN | OPEN | 0 |
----------------------------------------------------------------
=============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
=============================================
| VcName | DistributionId | comment |
---------------------------------------------
| vc1 | 1 | |
---------------------------------------------
| vc2 | 2 | |
---------------------------------------------
2 virtual cluster: vc1, vc2
4 coordinator node
0 free data node

GBase 8a 集群节点管理-扩容(多VC模式)相关推荐

  1. GBase 8a 集群节点管理-缩容(多VC模式)

    纯 data 节点缩容          集群环境描述: Coordinator 节点: 172.168.83.11, 172.168.83.12, 172.168.83.13, 172.168.83 ...

  2. GBase 8a集群v953版本自增列介绍

    GBase 8a集群验证版本 GBase8a_MPP_Cluster-NoLicense-9.5.3.23.2-redhat7-x86_64.tar.bz2 集群拓扑结果 [gbase@localho ...

  3. 必看 | 《GBase 8a 集群认证培训》学习指南

    亲爱的小伙伴: 欢迎来到"GBase 8a MPP Cluster 认证培训"在线课堂,你很有眼光,已经超越很多人意识到国产数据库崛起的趋势,百忙之中参加具有18年发展历史的南大通 ...

  4. zookeeper集群节点热扩容和迁移详解

    推荐阅读 Helm3(K8S 资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506 Helm3(K8S 资源对象管理工具)博客专栏:https: ...

  5. GBase 8a集群目录结构

    GBase 8a集群各节点间的目录结构是一样的,各目录的作用说明如下: 目录 说明 /opt/gnode 节点数据库安装路径 /opt/gnode/server 节点数据库的服务文件路径,包含有lib ...

  6. 【Elasticsearch】ELASTICSEARCH集群节点的扩容(移除与添加)

    1.概述 转载:ELASTICSEARCH集群节点的扩容(移除与添加) 0x01 前言 我的elasticsearch集群在刚建立之初只是想用于测试,所以每个节点只有300G的磁盘空间.但后来用在我自 ...

  7. GBase 8a 集群维护工具C3介绍

    当集群节点机器很多时,例如 20 个节点时,对于集群的一些维护工作需要在每个节点上都执行一次相同操作,这样十分耗时,而且繁琐. 可使用 C3 工具,可以减少集群节点的维护操作,仅在装有 C3 工具的节 ...

  8. 达梦dsc集群节点在线扩容

    文章目录 前言 一.导出DCR配置文件(export dmdcr_cfg) 二.为新增节点添加日志文件 三.配置DMCSSM监视器 四.配置新增节点DSC2 4.1拷贝配置文件至新节点服务器上 4.2 ...

  9. 南大通用GBase 8s集群权限管理介绍

    一.用户管理 用户可以使用CREATE USER语句创建一个新的GBase 8s MPP帐号. 下面我们通过两个示例,来向用户展示创建用户和更改用户密码的操作. 示例1:使用超级用户root登录,创建 ...

最新文章

  1. 优雅的理解 call 和 apply 的使用方法
  2. 【转】[C# 基础知识系列]专题四:事件揭秘
  3. C++中的空类与空结构体大小
  4. ProgressBar(圆形、水平进度条)的基本使用(点击Button1按钮,显示或消失圆形ProgressBar)(每点击一次Button2按钮,水平进度条增加10%)
  5. java 中 的 字节流!
  6. 分布式文件系统—HDFS—IDEA的Hadoop可视化插件BigDataTools
  7. Web开发-Django初识及实战
  8. cl_ibase_ibintx_buf buffer class
  9. GPU Gems1 - 12 全方位的阴影映射
  10. 网络编程-TCP/IP协议栈-TCP协议
  11. c语言酒店管理系统设计目的,C语言酒店管理系统设计.doc
  12. java ref object_深入探讨 java.lang.ref 包
  13. 【转】移动互联网应用测试成长技能树V1.0
  14. 《深入理解JavaScript闭包和原型》笔记
  15. 数据中心降低运营成本战略解密
  16. 基于Java毕业设计幼儿园教育管理信息系统演示2021源码+系统+mysql+lw文档+部署软件
  17. TIFF图像文件格式分析
  18. 快速傅里叶变换(蝶形算法c++源代码)
  19. 小米10获取root权限_安卓刷机搞机小能手必备的三款root神器 最后一款你肯定用过...
  20. c语言乒乓球对手算法,乒乓球学生论文,关于例c语言教学案例设计相关参考文献资料-免费论文范文...

热门文章

  1. 方法重载与访问修饰符
  2. 吴晓敏:我和朴树好着呢 时刻准备要孩子(图)
  3. php5isapi.dll 没有,没有php5isapi.dll怎么办
  4. Android动态设置字体颜色
  5. 一物一码追踪溯源系统介绍
  6. 软件研发和嵌入式软件研发面试经历
  7. RTMP H5 直播流技术解析
  8. Vue轮播缩略图(element ui)+鼠标悬浮放大图片(PicZoom)商城详情页图片展示
  9. 乔任梁生前女友索要3000万遗产, 被网友质疑合影都是P图炒作
  10. java 包含几个字符_java怎么判断字符串中包含多少个字符