MIGRATE UNIT

2023-10-24 09:23:03  Updated

Purpose

You can use this statement to migrate resource units.

This statement can be executed only in the sys tenant.

To balance the resource distribution among multiple OBServer nodes in a zone, you can adjust the resource distribution among tenants to balance the resource usage among clusters. Before unit migration, you need to disable unit balancing and enable automatic leader switchover.

obclient> ALTER SYSTEM SET resource_soft_limit = 100;
obclient> ALTER SYSTEM SET enable_auto_leader_switch = 'on';

For more information about the preceding parameter, see "System parameters" in OceanBase Database Reference Guide.

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 address of the destination server to which the resource unit is migrated.

Examples

Migrate the resource unit whose unit_id is 1001 to the OBServer node whose IP address is xxx.xxx.xx.xx1.

obclient> ALTER SYSTEM MIGRATE UNIT = 1001 DESTINATION = 'xxx.xxx.xx.xx1:xxxx';
Query OK, 0 rows affected

Contact Us