功能说明
在批量执行rebalance 操作时,可以通过修改gclusterdb.rebalancing_status 表调整单
个rebalance 任务的优先级。priority 值最小的任务先做。
语法格式
update gclusterdb.rebalancing_status set priority =
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-04-10)
南大通用数据技术股份有限公司
358
+------------+----------+----------+
| 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-04-10)
南大通用数据技术股份有限公司
359
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set