返回首页

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

更新日期:2024年09月11日

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

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
382
执行完毕后,启动集群备份命令,即可进行备份操作了。
语法格式
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-09-15)
南大通用数据技术股份有限公司
383
==========================================================
|
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-09-15)
南大通用数据技术股份有限公司
384
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-09-15)
南大通用数据技术股份有限公司
385
$ 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-09-15)
南大通用数据技术股份有限公司
386
|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


在GBase 8c 上建立外表时,
不会同步在MariaDB/MySQL Server 上建表,
需要自己利用
MariaDB/MySQL Server 的客户端连接MariaDB/MySQL Server 建表。

创建USER MAPPING 时使用的MariaDB/MySQL Server 用户需要有远程连接
MariaDB/MySQL Server 及对表相关操作的权限。使用外表前,可以在GBase 8c server
所在的机器上,使用MariaDB/MySQL Server 的客户端,使用对应的用户名密码确认能
否成功连接MariaDB/MySQL Server 并进行操作。

对外表执行DML 操作时,
出现Can't initialize character set SQL_ASCII (path: compiled_in)
错误。
由于MariaDB 不支持SQL_ASCII 编码格式,
目前只能通过修改GBase 8c database
的编码格式解决该问题。
修改database 编码格式的方式为update pg_database set encoding
= pg_char_to_encoding('UTF-8') where datname = 'postgres'; datname 根据实际情况填写。
注意修改完编码格式后,需要重新开启一个gsql 会话,才能使mysql_fdw 使用更新后
的参数。也可以通过在执行gs_initdb 时,使用–locale=LOCALE,指定默认的编码格式
为非SQL_ASCII 编码。

GBA-01BR-0062
错误码
错误标识
错误显示信息
GBA-01BR-0062

open DC data file Error
错误出现原因
打开数据文件错误
分析与建议
检查数据文件的权限及状态