Purpose
This statement is used for unit migration.
This statement can only be executed in the sys tenant.
When the resource distribution is uneven among multiple OBServer nodes in a single zone of a cluster, you can adjust the resource distribution of the tenant to balance the cluster resources. Before performing unit migration, you need to disable load balancing. The syntax is as follows:
obclient> ALTER SYSTEM SET enable_rebalance = false;
For more information about the above configuration items, see the System Configuration section in the OceanBase Database Reference Manual.
Syntax
alter_system_unit_stmt:
ALTER SYSTEM MIGRATE
UNIT [=] unit_id DESTINATION [=] ip_port
unit_id:
INT_VALUE
Parameters
| Parameter | Description |
|---|---|
| unit_id | The unit ID. |
| ip_port | The IP address of the target OBServer node. |
Examples
Migrate the resource unit with unit_id 1001 to the OBServer node with IP address xxx.xxx.xx.xx1.
obclient> ALTER SYSTEM MIGRATE UNIT = 1001 DESTINATION = 'xxx.xxx.xx.xx1:xxxx';
Query OK, 0 rows affected
