Note
- This parameter is available starting with V1.4.
- Starting from V4.2.0, the scope of this parameter is changed from cluster-level to tenant-level.
Description
enable_rebalance specifies whether to enable automatic load balancing.
This parameter controls different balancing operations for different tenants:
In the sys tenant, this parameter specifies whether to enable tenant-level load balancing.
- false: The system does not perform background unit migration. However, if a node is permanently offline or in the DELETING state, unit migration is not controlled by this parameter.
- true: The system can perform unit migration to achieve load balancing.
In a user tenant, this parameter specifies whether to enable automatic load balancing within the tenant.
false: The system does not perform load balancing within the tenant. Any ongoing load balancing operations are canceled. If you perform the following operations, an error is returned:
- Increase or decrease the number of units in the tenant.
- Change the primary zone with the highest priority. If the primary zone with the highest priority does not change, no error is returned.
- Change the number of F replicas when the primary zone is set to RANDOM.
Notice
- Starting from V4.3.5 BP1, if you set
enable_rebalancetofalse, no error is returned when the primary zone with the highest priority changes or the number of F replicas changes when the primary zone is set to RANDOM. - Although no error is returned after you set
enable_rebalancetofalse, the system does not perform load balancing. You can perform the required changes in batches whileenable_rebalanceis set tofalse, and then enable automatic load balancing by settingenable_rebalancetotrue.
true: The system can perform load balancing within the tenant.
Note
- To enable tenant-level load balancing, set
enable_rebalancetotruein the sys tenant. If you setenable_rebalancetofalse, tenant-level load balancing is disabled. - To enable automatic load balancing and automatic partition migration for a tenant, set
enable_rebalancetotruein the tenant. If you setenable_rebalancetofalse, automatic load balancing and automatic partition migration are disabled.
Privilege requirements
Query the parameter
You can use the
SHOW PARAMETERSstatement or query theGV$OB_PARAMETERSview to query this parameter in the sys tenant and all user tenants.Modify the parameter
You can modify this parameter in the sys tenant and all user tenants.
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. The setting takes effect immediately. |
Examples
Disable tenant-level and automatic load balancing.
obclient> ALTER SYSTEM SET enable_rebalance = false tenant = all_user;Enable tenant-level load balancing only.
obclient> ALTER SYSTEM SET enable_rebalance = true tenant='all_user';Disable tenant-level load balancing, and enable automatic load balancing.
obclient> ALTER SYSTEM SET enable_rebalance = false tenant='all_user'; ALTER SYSTEM SET enable_rebalance = true tenant='MYSQL';