南大通用数据库-Gbase-8a-MPP-Cluster-添加备份节点-09

一、测试环境

名称
cpuIntel® Core™ i5-1035G1 CPU @ 1.00GHz
操作系统CentOS Linux release 7.9.2009 (Core)
内存4G
逻辑核数3
节点1-IP192.168.142.10
节点2-IP192.168.142.11
数据库版本8.6.2.43-R33.132743

二、操作步骤

1、查看集群状态
[gbase@localhost gcinstall]$ gcadmin 
[gbase@localhost gcinstall]$ gcadmin showdistribution

              Distribution ID: 4 | State: new | Total segment num: 2

     Primary Segment Node IP                           Segment ID         Duplicate Segment node IP
========================================================================================================================
|    192.168.142.11                              |       1          |                                                  |
------------------------------------------------------------------------------------------------------------------------
|    192.168.142.10                              |       2          |                                                  |
=========================================================================================
2、设置分布策略
[gbase@localhost gcinstall]$ cat gcChangeInfo.xml 
<?xml version="1.0" encoding="utf-8"?>
<servers>
 <rack>
  <node ip="192.168.142.11"/>
  <node ip="192.168.142.10"/>
 </rack>
</servers>

[gbase@localhost gcinstall]$ gcadmin distribution gcChangeInfo.xml p 1 d 1
gcadmin generate distribution ...

gcadmin generate distribution successful
3、查看分布情况
 
[gbase@localhost gcinstall]$ gcadmin showdistribution

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

     Primary Segment Node IP                           Segment ID         Duplicate Segment node IP
========================================================================================================================
|    192.168.142.11                              |       1          |    192.168.142.10                                |
------------------------------------------------------------------------------------------------------------------------
|    192.168.142.10                              |       2          |    192.168.142.11                                |
========================================================================================================================

              Distribution ID: 4 | State: old | Total segment num: 2

     Primary Segment Node IP                           Segment ID         Duplicate Segment node IP
========================================================================================================================
|    192.168.142.11                              |       1          |                                                  |
------------------------------------------------------------------------------------------------------------------------
|    192.168.142.10                              |       2          |                                                  |
========================================================================================================================

新的分布策略ID:5
老的分布策略ID:4
 

4、数据库初始化
[gbase@localhost gcinstall]$ gccli

GBase client 8.6.2.43-R33.132743. Copyright (c) 2004-2022, GBase.  All Rights Reserved.

gbase> initnodedatamap;
5、重分布

重分布支持instance, database、table三种等级。

gbase> rebalance instance;
6、查看重分布完成度
gbase> select * from  gclusterdb.rebalancing_status;
7、查看是否有表使用老的策略
gbase> select * from gbase.table_distribution where data_distribution_id=4;

如果有的话,请使用rebalance table 库名.表名,重新分布表。

8、删除老的刷新节点数据地图
gbase> refreshnodedatamap drop 4;
9、删除老的分布策略
[gbase@localhost gcinstall]$ gcadmin rmdistribution 4
10、查看是否成功

各节点状态正常,分布策略是最新的,有副本信息,说明我们添加数据副本成功啦

[gbase@localhost gcinstall]$ gcadmin
CLUSTER STATE:  ACTIVE
CLUSTER MODE:   NORMAL

=====================================================================
|               GBASE COORDINATOR CLUSTER INFORMATION               |
=====================================================================
|   NodeName   |       IpAddress       |gcware |gcluster |DataState |
---------------------------------------------------------------------
| coordinator1 |    192.168.142.10     | OPEN  |  OPEN   |    0     |
---------------------------------------------------------------------
| coordinator2 |    192.168.142.11     | OPEN  |  OPEN   |    0     |
---------------------------------------------------------------------
=================================================================
|                GBASE DATA CLUSTER INFORMATION                 |
=================================================================
|NodeName |       IpAddress       |gnode |syncserver |DataState |
-----------------------------------------------------------------
|  node1  |    192.168.142.10     | OPEN |   OPEN    |    0     |
-----------------------------------------------------------------
|  node2  |    192.168.142.11     | OPEN |   OPEN    |    0     |
-----------------------------------------------------------------
[gbase@localhost gcinstall]$ gcadmin showdistribution

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

     Primary Segment Node IP                           Segment ID         Duplicate Segment node IP
========================================================================================================================
|    192.168.142.11                              |       1          |    192.168.142.10                                |
------------------------------------------------------------------------------------------------------------------------
|    192.168.142.10                              |       2          |    192.168.142.11                                |
========================================================================================================================

  • 10
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值