返回首页

gbase数据、南大通用产品文档:GBase8a在VC1 上创建distribution

更新日期:2024年09月11日

操作场景
多VC 模式,需要在每个VC 下创建distribution。
操作步骤
步骤1
编辑vc1 的创建distribution 的配置文件gcChangeInfo_vc1.xml。在指定VC 中创建
distribution 时,创建distribution 的配置文件gcChangeInfo_vc1.xml 中的node IP 与
创建VC 的配置文件中的node IP 一致。
示例:编辑在vc1 上创建distribution 的配置文件gcChangeInfo_vc1.xml 内容如下:
$cd gcinstall
$cp gcChangeInfo.xml gcChangeInfo_vc1.xml
$vi /opt/gcinstall/gcChangeInfo_vc1.xml











步骤2
在安装目录下,执行创建distribution 命令。
gcadmin distribution

[d num] [pattern 1|2]
表3- 10 参数说明
参数名称


gcChangeInfo.xml
指定生成distribution 规则的配置文件。
p number
每个数据节点存放的分片数量,最小值为1。
d number
每个分片的备份数量,取值为0,1 或2。若不输入参数d,
默认值为1。

GBase 8a MPP Cluster 产品手册
3 集群安装升级与卸载
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
81
参数名称


pattern number
生成distribution 所使用模式,
取值为1 或2,pattern 1 为负载
均衡模式,
pattern 2 为高可用模式。
若不输入参数pattern,

认使用pattern 1 生成distribution。
vc vcname
要创建distribution 的vc 名称。
说明

gcadmin distribution 是gcadmin 的子命令,详细说明请参考4.3.1 gcadmin
章节。
执行结果如下:
$cd /opt/gcinstall
$ gcadmin distribution gcChangeInfo_vc1.xml p 1 d 1 vc vc1
gcadmin generate distribution ...
NOTE: node [192.168.146.21] is coordinator node, it shall be data node too
NOTE: node [192.168.146.20] is coordinator node, it shall be data node too
gcadmin generate distribution successful
说明

在某个VC 上创建distribution 时,gcChangeInfo_vc1.xml 文件中的node ip
要与创建VC 时配置文件中的node ip 一致;

创建distribution 时必须指定vc name,当集群只有一个vc 时,默认在该vc
上生成distribution 可以不指定vcname。

ifx_lo_stat_mtime_sec() 函数返回智能大对象的最后修改的时间。

语法
mint ifx_lo_stat_mtime_sec(LO_stat)
ifx_lo_stat_t *LO_stat;

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 802 -
LO_stat
指向 ifx_lo_stat() 分配并以状态信息完成的 LO-status 结构的指针。

用法
ifx_lo_stat_mtime_sec() 函数返回的时间的分辨率为秒。

智能大对象的状态信息在 LO_stat 指向的 LO-status 结构中。ifx_lo_stat() 函数分配
此结构,并以特定的智能大对象的状态信息完成它。因此,您必须先以对 ifx_lo_stat() 的
调用来调用 ifx_lo_stat_mtime_sec()。

返回代码
>=0
LO_stat 标识的智能大对象的最后修改时间。
-1
函数成功。

或返回TRUE,如果操作数是正确的。
DECLARE PROCEDURE print_x_or_y (
x BOOLEAN, y BOOLEAN) IS
BEGIN
print_boolean ('x', x);
print_boolean ('y', y);
print_boolean ('x OR y', x OR y);
END print_x_or_y;
BEGIN
print_x_or_y (FALSE, FALSE);
print_x_or_y (TRUE, FALSE);
print_x_or_y (FALSE, TRUE);
print_x_or_y (TRUE, TRUE);
print_x_or_y (TRUE, NULL);
print_x_or_y (FALSE, NULL);
print_x_or_y (NULL, TRUE);
print_x_or_y (NULL, FALSE);
END;

--Result:
--x = FALSE
--y = FALSE

GBase 8s PL/SQL手册
南大通用数据技术股份有限公司
- 29 -

--x OR y = FALSE

--x = TRUE
--y = FALSE
--x OR y = TRUE

--x = FALSE
--y = TRUE
--x OR y = TRUE

--x = TRUE
--y = TRUE
--x OR y = TRUE

--x = TRUE
--y = NULL
--x OR y = TRUE

--x = FALSE
--y = NULL
--x OR y = NULL

--x = NULL
--y = TRUE
--x OR y = TRUE

--x = NULL
--y = FALSE
--x OR y = NULL