返回首页

gbase数据、南大通用产品文档:GBase8a集群级备份集群数据

更新日期:2024年09月11日

功能说明
使用交互模式或者命令方式运行backup level [0 | 1],即可完成数据备份。进行备份
操作时,必须保证集群在READONLY 模式下。
首先使用gcadmin switchmode readonly 命令将集群置为READONLY 模式,此命令
仅在一个部署gcware 的节点上执行一次即可。

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
378
执行完毕后,启动集群备份命令,即可进行备份操作了。
语法格式
backup level < 0 | 1 >
示例
步骤1:查看集群状态:
$ 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
| comment message for vc1 |
-----------------------------------------------------------
|
vc2
|
2
| comment message for vc2 |
-----------------------------------------------------------
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
|

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
379
==========================================================
|
VcName
| DistributionId |
comment
|
----------------------------------------------------------
|
vc1
|
1
| comment message for vc1 |
----------------------------------------------------------
===========================================================
=======
|
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
|
------------------------------------------------------------------
2 data node
$ gcadmin showcluster vc vc2
CLUSTER STATE:
ACTIVE
VIRTUAL CLUSTER MODE:
NORMAL
==========================================================
|
GBASE VIRTUAL CLUSTER INFORMATION
|
==========================================================
|
VcName
| DistributionId |
comment
|
----------------------------------------------------------
|
vc2
|
2
| comment message for vc2 |
----------------------------------------------------------
===========================================================
=======
|
VIRTUAL CLUSTER DATA NODE INFORMATION
|
===========================================================
=======
|NodeName|
IpAddress
|DistributionId|gnode|syncserver|DataState|
------------------------------------------------------------------
| node1
|172.168.83.13|
2
|OPEN |
OPEN
|
0
|
------------------------------------------------------------------
| node2
|172.168.83.14|
2
|OPEN |
OPEN
|
0
|
------------------------------------------------------------------

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
380
2 data node
步骤2:设置集群内所有vc 的状态为readonly:
$ gcadmin switchmode readonly vc vc1
========== switch cluster mode...
switch pre mode:
[NORMAL]
switch mode to
[READONLY]
switch after mode:
[READONLY]
$ gcadmin switchmode readonly vc vc2
========== switch cluster mode...
switch pre mode:
[NORMAL]
switch mode to
[READONLY]
switch after mode:
[READONLY]
$ 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
| comment message for vc1 |
-----------------------------------------------------------
|
vc2
|
2
| comment message for vc2 |
-----------------------------------------------------------
2 virtual cluster: vc1, vc2
3 coordinator node
0 free data node

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
381
$ gcadmin showcluster vc vc1
CLUSTER STATE:
ACTIVE
VIRTUAL CLUSTER MODE:
READONLY
==========================================================
|
GBASE VIRTUAL CLUSTER INFORMATION
|
==========================================================
|
VcName
| DistributionId |
comment
|
----------------------------------------------------------
|
vc1
|
1
| comment message for vc1 |
----------------------------------------------------------
===========================================================
=======
|
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
|
------------------------------------------------------------------
2 data node
$ gcadmin showcluster vc vc2
CLUSTER STATE:
ACTIVE
VIRTUAL CLUSTER MODE:
READONLY
===========================================================
|
GBASE VIRTUAL CLUSTER INFORMATION
|
===========================================================
|
VcName
| DistributionId |
comment
|
-----------------------------------------------------------
|
vc2
|
2
| comment message for vc2 |
-----------------------------------------------------------
===========================================================
=======
|
VIRTUAL CLUSTER DATA NODE INFORMATION
|
===========================================================
=======

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
382
|NodeName|
IpAddress
|DistributionId|gnode|syncserver|DataState|
------------------------------------------------------------------
| node1
|172.168.83.13|
2
|OPEN |
OPEN
|
0
|
------------------------------------------------------------------
| node2
|172.168.83.14|
2
|OPEN |
OPEN
|
0
|
------------------------------------------------------------------
2 data node
使用交互模式进行全备:
$ python $GCLUSTER_BASE/server/bin/gcrcman.py -d /home/gbase/backup -P
gbasedba –p ******
gcrcman>backup level 0

GBA-02DR-0026
错误码
错误标识
错误信息
GBA-02DR-0026

Gcluster
metadata(hashmap)
and
actual node are not consistent
错误出现原因
nodedatamap 表和实际数据分布节点不一致
分析与建议
某些误操作导致,如直接通过gnode 进行insert 或load 操作

当某行包含定义在 ROW 类型上的列时,您可使用点符号表示法来指定仅删除那些包含特
定字段值的行。例如,下列语句仅从 employee 表中删除address 列中的 city 字段的值为 San
Jose 的那些行:
DELETE FROM employee
WHERE address.city = 'San Jose';
在前面的语句中,address 列可能是命名的 ROW 类型或未命名的 ROW 类型。您用来指
定 ROW 类型的字段值的语法是相同的。