enable_rebalance specifies whether to enable automatic load balancing.
- If you set this parameter in the sys tenant, it specifies whether to enable load balancing across tenants.
- If you set this parameter in a user tenant, it specifies whether to enable load balancing within the tenant.
Note
The effective scope is changed to Tenant in OceanBase Database V4.2.0 and later.
| Property | Description |
|---|---|
| Type | Boolean |
| Default value | True |
| Value range |
|
| Effective upon OBServer node restart | No |
You can specify the parameter in different tenants to control different balancing operations:
In the sys tenant
- false: Units are not migrated in the background. However, when the node is permanently removed or in the DELETING state, unit migration is not controlled by the parameter.
- true: Unit migration can be performed to achieve load balancing.
In a user tenant
- false: No more load balancing operations are performed within the tenant. Load balancing operations in progress are canceled. If a scaling operation, such as any of the following operations, is initiated when the value is set to false, an error is reported:
- Change the number of units in the tenant.
- Change the primary zone of the top priority.
- Change the number of full-featured replicas when primary_zone is set to RANDOM.
- true: Load balancing operations can be performed within the tenant.
- false: No more load balancing operations are performed within the tenant. Load balancing operations in progress are canceled. If a scaling operation, such as any of the following operations, is initiated when the value is set to false, an error is reported:
Note
- To enable load balancing across tenants, set the
enable_rebalanceparameter toTruein the sys tenant. You can disable this parameter to ensure that no cross-tenant load balancing operation is performed. - To enable scaling of a tenant or automatic balancing and migration of partitions in the tenant, enable the
enable_rebalanceparameter in the tenant. To disable the automatic load balancing within a tenant, disable this parameter in the tenant.
Examples
Disable both cross-tenant and intra-tenant load balancing:
alter system set enable_rebalance = false tenant = ALL;Enable only cross-tenant load balancing:
alter system set enable_rebalance = true tenant='SYS';Disable cross-tenant load balancing and enable intra-tenant load balancing:
alter system set enable_rebalance = false tenant='SYS'; alter system set enable_rebalance = true tenant='MYSQL';