返回首页

gbase数据、南大通用产品文档:GBase8a调整rebalance 任务优先级

更新日期:2024年09月11日

功能说明
在批量执行rebalance 操作时,可以通过修改gclusterdb.rebalancing_status 表调整单
个rebalance 任务的优先级。priority 值最小的任务先做。
语法格式
update gclusterdb.rebalancing_status set priority = where
index_name='database_name.table_name';
表4- 46 参数说明
参数名称


priority_value
Priority_value 指定的值最小的任务先做,
默认该值为5。
database_name.table_name
指定要调整优先级的表的名称,可以通

select
index_name,
status,
priority
from
gclusterdb.rebalancing_status 命令查看,
即为查询结果中index_name 列对应的
值。
操作步骤
1)设置gcluster_rebalancing_concurrent_count 值为0。
gbase> set global gcluster_rebalancing_concurrent_count = 0;
Query OK, 0 rows affected
2)执行rebalance database 命令增加rebalance 任务。
此时所有rebalance 任务都不会
开始。
gbase> rebalance database test;
Query OK, 3 rows affected
3)调整rebalance 任务的优先级。
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
362
+------------+----------+----------+
| test.t3
| STARTING |
5 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
5 |
+------------+----------+----------+
3 rows in set
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
6
where
index_name='test.t3';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
4
where
index_name='test.t2';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
4 |
+------------+----------+----------+
3 rows in set
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set
4)调整完之后设置gcluster_rebalancing_concurrent_count 为需要的并发数
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
363
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set

使用“新建函数过程”功能,您可以图形化创建函数过程。
在“数据库导航”中,右键单击Schema 节点下的函数过程节点,选择菜单
中的“新建函数过程”菜单项,如下图所示:

GBaseDataStudio 管理工具手册
南大通用数据技术股份有限公司
- 325 -
图5- 727 新建函数过程菜单项
点击“新建函数过程”菜单弹出新建对话框,如下图所示:
图5- 728 新建函数过程对话框
在新建函数过程对话框中填写名称,然后点击“确定”按钮进入函数过程
编辑界面如下图所示:

GBaseDataStudio 管理工具手册
- 326 -
南大通用数据技术股份有限公司
图5- 729 新建函数过程编辑
在函数过程编辑界面“源”编辑框中编辑函数过程主体,编辑完成后点击
工具栏中的“保存”按钮或者点击“Ctrl+S”来保存,弹出保存确认界面如下
图所示:

GBaseDataStudio 管理工具手册
南大通用数据技术股份有限公司
- 327 -
图5- 730 新建函数过程编辑
点击“保存”按钮,您可以保存这次新建函数过程;点击“复制”按钮,
您可以将新建函数过程的SQL 语句拷贝到粘贴板;点击“取消”按钮,您可以
取消本次保存。保存后将刷新函数过程内容。

根据操作系统的版本(同一套集群使用相同版本操作系统)获取相应的GBase 8a
MPP Cluster 软件安装包。
软件安装包版本规则如下:
GBase8a_MPP_Cluster-[No]License-9.5.3.xx-OSversion-platform.tar.bz2
表3- 5 GBase 8a MPP Cluster 软件安装包
软件包文件
操作系

获取方式
GBase8a_MPP_Cluster-[No]License-9.5.3.X-SU
SExx-x86_64.tar.bz2
Suse
通过南大通用公司销售
或售前人员申请软件安
装包及手册。
GBase8a_MPP_Cluster-[No]License-9.5.3.X-red
hatxx-x86_64.tar.bz2
Redhat
通过南大通用公司销售
或售前人员申请软件安
装包及手册。

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