Note
- This parameter was introduced in OceanBase Database V1.4.
- The effective scope of this parameter has been changed from the cluster level to the tenant level since OceanBase Database V4.2.0.
Description
enable_rebalance specifies whether to enable automatic load balancing.
You can specify the parameter in different tenants to control different balancing operations:
In the
systenant, it specifies whether to enable load balancing across tenants.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, it specifies whether to enable load balancing 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:- 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.
Note
- If you want 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. - If you want to enable scaling of a tenant or automatic load balancing and migration of partitions in the tenant, set the
enable_rebalanceparameter totruein the tenant. If you want to disable automatic load balancing in a tenant, set this parameter tofalsein the tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Boolean |
| Default value | True |
| Value range |
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No |
Examples
Disable both cross-tenant and intra-tenant load balancing
obclient> ALTER SYSTEM SET enable_rebalance = false tenant = all_user;Enable only cross-tenant load balancing
obclient> ALTER SYSTEM SET enable_rebalance = true tenant='all_user';Disable cross-tenant load balancing and enable intra-tenant load balancing
obclient> ALTER SYSTEM SET enable_rebalance = false tenant='all_user'; ALTER SYSTEM SET enable_rebalance = true tenant='MYSQL';