GBase 8a
安装配置
文章

GBase 8a MPP Cluster V9扩容数据节点示例

发表于2024-04-15 09:28:3419次浏览2个评论

扩容场景

软件版本:GBase 8a MPP Cluster V9。

集群结构:集群为2个VC(虚拟集群)构成的GBase 8a MPP集群,设置3个管理节点,数据节点分为2个VC:3数据节点VC_FIR+2数据节点VC_SEC。

扩容目标:在VC_FIR扩容2个数据节点,VC_SEC保持不变。

初始集群结构

[gbase@node042 gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE

=============================================================
|           GBASE COORDINATOR CLUSTER INFORMATION           |
=============================================================
|   NodeName   | IpAddress  | gcware | gcluster | DataState |
-------------------------------------------------------------
| coordinator1 | 192.168.1.42 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator2 | 192.168.1.43 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator3 | 192.168.1.44 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_fir    |       3        |           |
---------------------------------------------
|  vc_sec   |       4        | comment   |
---------------------------------------------

2 virtual cluster: vc_fir, vc_sec
3 coordinator node
0 free data node

[gbase@node042 gcinstall]$ gcadmin showcluster vc vc_fir
CLUSTER STATE:         ACTIVE
VIRTUAL CLUSTER MODE:  NORMAL

=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_fir    |       3        |           |
---------------------------------------------
=========================================================================================================
|                                 VIRTUAL CLUSTER DATA NODE INFORMATION                                 |
=========================================================================================================
| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
|  node1   |                192.168.1.42                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node2   |                192.168.1.43                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node3   |                192.168.1.44                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------

3 data node

[gbase@node042 gcinstall]$ gcadmin showcluster vc vc_sec
CLUSTER STATE:         ACTIVE
VIRTUAL CLUSTER MODE:  NORMAL

=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_sec    |       4        |           |
---------------------------------------------
=========================================================================================================
|                                 VIRTUAL CLUSTER DATA NODE INFORMATION                                 |
=========================================================================================================
| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
|  node1   |                192.168.1.131                |       4        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node2   |                192.168.1.132                |       4        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------

2 data node

扩容机器检查

节点扩容

1、gbase账户登陆集群管理节点192.168.1.42

2、修改安装配置文件demo.options

[gbase@node042 gcinstall]$ cd /opt/product/gcinstall
[gbase@node042 gcinstall]$ cat demo.options
installPrefix= /opt
#coordinateHost = 192.168.1.42,192.168.1.43,192.168.1.44
#coordinateHostNodeID = 368251052,385028268
dataHost = 192.168.1.144,192.168.1.188
existCoordinateHost = 192.168.1.42,192.168.1.43,192.168.1.44
existDataHost = 192.168.1.42,192.168.1.43,192.168.1.44,192.168.1.132,192.168.1.133
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'xxxxxx'

3、安装扩容节点

[gbase@node042 gcinstall]$ /gcinstall.py --silent=demo.options

4、检查扩容节点(确认扩容节点已增加为freenode)


[gbase@node042 gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE

=============================================================
|           GBASE COORDINATOR CLUSTER INFORMATION           |
=============================================================
|   NodeName   | IpAddress  | gcware | gcluster | DataState |
-------------------------------------------------------------
| coordinator1 | 192.168.1.42 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator2 | 192.168.1.43 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator3 | 192.168.1.44 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_fir    |       3        |           |
---------------------------------------------
|  vc_sec   |       4        | comment   |
---------------------------------------------
============================================================
|         GBASE CLUSTER FREE DATA NODE INFORMATION         |
============================================================
| NodeName  |  IpAddress  | gnode | syncserver | DataState |
------------------------------------------------------------
| FreeNode1 | 192.168.1.144 | OPEN  |    OPEN    |     0     |
------------------------------------------------------------
| FreeNode2 | 192.168.1.188 | OPEN  |    OPEN    |     0     |
------------------------------------------------------------

2 virtual cluster: vc_fir, vc_sec
3 coordinator node
2 free data node

5、编辑扩容节点配置文件add_vc_fir_node.xml

[gbase@node042 gcinstall]$ cat add_vc_fir_node.xml
<?xml version="1.0" encoding="utf-8"?>
<servers>
 <rack>
  <node ip="192.168.1.144"/>
  <node ip="192.168.1.188"/>
 </rack>
</servers>

6、将扩容节点加入vc_fir VC

[gbase@node042 gcinstall]$ gcadmin addnodes add_vc_fir_node.xml vc_fir

7、检查扩容节点(确认新节点加入vc_fir VC)


[gbase@node042 gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE

=============================================================
|           GBASE COORDINATOR CLUSTER INFORMATION           |
=============================================================
|   NodeName   | IpAddress  | gcware | gcluster | DataState |
-------------------------------------------------------------
| coordinator1 | 192.168.1.42 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator2 | 192.168.1.43 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
| coordinator3 | 192.168.1.44 |  OPEN  |   OPEN   |     0     |
-------------------------------------------------------------
=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_fir    |       3        |           |
---------------------------------------------
|  vc_sec   |       4        | comment   |
---------------------------------------------

2 virtual cluster: vc_fir, vc_sec
3 coordinator node
0 free data node

[gbase@node042 gcinstall]$ gcadmin showcluster vc vc_fir
CLUSTER STATE:         ACTIVE
VIRTUAL CLUSTER MODE:  NORMAL

=============================================
|     GBASE VIRTUAL CLUSTER INFORMATION     |
=============================================
|    VcName    | DistributionId |  comment  |
---------------------------------------------
|    vc_fir    |       3        |           |
---------------------------------------------
=========================================================================================================
|                                 VIRTUAL CLUSTER DATA NODE INFORMATION                                 |
=========================================================================================================
| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
|  node1   |                192.168.1.42                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node2   |                192.168.1.43                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node3   |                192.168.1.44                |       3        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node4   |               192.168.1.144                |                | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node5   |               192.168.1.188                |                | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------

5 data node

8、编辑vc_fir VC第2个distribution配置文件

[gbase@node042 gcinstall]$ cat gcChangeInfo.xml 
<?xml version="1.0" encoding="utf-8"?>
<servers>
 <rack>
  <node ip="192.168.1.42"/>
  <node ip="192.168.1.43"/>
  <node ip="192.168.1.44"/>
  <node ip="192.168.1.144"/>
  <node ip="192.168.1.188"/>
 </rack>
</servers>

9、创建vc_fir VC第2个distribution


[gbase@node042 gcinstall]$ gcadmin distribution gcChangeInfo.xml p 1 d 1 db_user gbase db_pwd 'xxxxxxxx' vc vc_fir
[gbase@node042 gcinstall]$ gcadmin showdistribution vc vc_fir

                                 Distribution ID: 6 | State: new | Total segment num: 5

             Primary Segment Node IP                   Segment ID                 Duplicate Segment node IP
========================================================================================================================
|                   192.168.1.42                   |         1          |                   192.168.1.43                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.43                   |         2          |                   192.168.1.44                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.44                   |         3          |                  192.168.1.144                   |
------------------------------------------------------------------------------------------------------------------------
|                  192.168.1.144                   |         4          |                  192.168.1.188                   |
------------------------------------------------------------------------------------------------------------------------
|                  192.168.1.188                   |         5          |                   192.168.1.42                   |
========================================================================================================================

                                 Distribution ID: 3 | State: old | Total segment num: 3

             Primary Segment Node IP                   Segment ID                 Duplicate Segment node IP
========================================================================================================================
|                   192.168.1.42                   |         1          |                   192.168.1.43                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.43                   |         2          |                   192.168.1.44                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.44                   |         3          |                   192.168.1.42                   |
========================================================================================================================

10、初始化新的distribution
gbase账户gccli连接集群,执行:

gbase> use vc vc_fir;
gbase> initnodedatamap;

数据重分布

1、设置重分布参数

根据数据量级及系统资源情况设置重分布参数,下面是3个常用参数:

gbase> set gcluster_rebalancing_step = 1000000000;  --重分布处理单批次记录数,值越大,重分布速度越快
gbase> set global gcluster_rebalancing_parallel_degree = 4; --重分布并行度
gbase> set global gcluster_rebalancing_concurrent_count = 4; --重分布并发任务数

2、启动重分布

gbase> rebalance instance;

3、等待重分布完成
查看gclusterdb.rebalancing_status表,当所有表的status都为COMPLETED,重分布完成:

gbase> select status,count(1) from gclusterdb.rebalancing_status group by status;

删除老的distribution

1、确认老的distribution_id:数字小的distribution_id

gbase> select distinct data_distribution_id from gbase.nodedatamap;

2、更新nodedatamap

gbase> refreshnodedatamap drop [N]; --N为旧distribution_id

3、删除老的distribution

[gbase@node042 gcinstall]$ gcadmin rmdistribution [N] vc vc_fir

4、查看并确认distribution:老distribution已删除

[gbase@node042 gcinstall]$ gcadmin showdistribution vc vc_fir

                                 Distribution ID: 6 | State: new | Total segment num: 5

             Primary Segment Node IP                   Segment ID                 Duplicate Segment node IP
========================================================================================================================
|                   192.168.1.42                   |         1          |                   192.168.1.43                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.43                   |         2          |                   192.168.1.44                   |
------------------------------------------------------------------------------------------------------------------------
|                   192.168.1.44                   |         3          |                  192.168.1.144                   |
------------------------------------------------------------------------------------------------------------------------
|                  192.168.1.144                   |         4          |                  192.168.1.188                   |
------------------------------------------------------------------------------------------------------------------------
|                  192.168.1.188                   |         5          |                   192.168.1.42                   |
========================================================================================================================

gbase

评论

登录后才可以发表评论
崔哥发表于 7个月前
金陵故都最好,有朱楼迢递。嗟倦客又此凭高,槛外已少佳致。更落尽梨花,飞尽杨花,春也成憔悴。问青山、三国英雄,六朝奇伟?麦甸葵丘,荒台败垒,鹿豕衔枯荠。正潮打孤城,寂寞斜阳影里。听楼头、哀笳怨角,未把酒、愁心先醉。渐夜深、月满秦淮,烟笼寒水。凄凄惨惨,冷冷清清,灯火渡头市。慨商女、不知兴废,隔江犹唱庭花,余音亹亹。伤心千古,泪痕如洗。乌衣巷口青芜路,认依稀、王谢旧邻里。临春结绮,可怜红粉成灰,萧索白杨风起。因思畴昔,铁索千寻,谩沉江底。挥羽扇,障西尘,便好角巾私第。清谈到底成何事?回首新亭,风景今如此。楚囚对泣何时已,叹人间今古真儿戏。东风岁岁还来,吹入钟山,几重苍翠。
用户头像
levvel发表于 2个月前
必须点赞!