You can modify the UNIT, UNIT_NUM, and ZONE_LIST parameters for a resource pool.
Limitations
Since OceanBase Database V4.0, the number of resource units must be the same for all resource pools of a tenant. After resource pools are allocated to a tenant, you cannot separately modify the UNIT_NUM parameter for a resource pool. You can only increase the value of the UNIT_NUM parameter for all resource pools of the tenant.
Procedure
Log on to the
systenant of the cluster as therootuser.Execute the following statement to modify the resource pool.
Sample statement:
ALTER RESOURCE POOL pool_name UNIT [=] unit_name, UNIT_NUM [=] unit_num [DELETE UNIT = (unit_id_list)], ZONE_LIST [=] ('zone'[, 'zone' ...]);Notes:
You can execute this statement to modify only one parameter at a time.
The
UNIT_NUMparameter specifies the number of resource units in each zone. The value of this parameter must be less than or equal to the number of OBServer nodes in the zone.Before a resource pool is allocated to a tenant, you can use the
ALTER RESOURCE POOLstatement to increase or decrease the value of theUNIT_NUMparameter for this resource pool. After a resource pool is allocated to a tenant, you can only use theALTER RESOURCE TENANTstatement to modify theUNIT_NUMparameter for all resource pools in the tenant.After a resource pool is allocated to a tenant, you can execute the following statement to modify the
UNIT_NUMparameter for all resource pools in the tenant.ALTER RESOURCE TENANT tenant_name UNIT_NUM [=] unit_num;The
ZONE_LISTparameter specifies the zones allowed to use the resource pool.
Assume that the following resource units and resource pool are available in the current environment:
obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 6,MIN_CPU 6, MEMORY_SIZE '36G', MAX_IOPS 1024, MIN_IOPS 1024, IOPS_WEIGHT 0, LOG_DISK_SIZE '2G'; obclient> CREATE RESOURCE POOL pool1 UNIT 'unit1', UNIT_NUM 2, ZONE_LIST ('z1','z2','z3');Examples:
Replace resource unit
unit1of resource poolpool1withunit2.obclient> CREATE RESOURCE UNIT unit2 MAX_CPU 8, MIN_CPU=8, MEMORY_SIZE '40G'; obclient> ALTER RESOURCE POOL pool1 unit='unit2';Change the number of resource units in each zone to 3 for all resource pools in the tenant.
obclient> ALTER RESOURCE TENANT pool1 UNIT_NUM = 3;Extend
ZONE_LISTof resource poolpool1to'z1','z2','z3','z4'.obclient> ALTER RESOURCE POOL pool1 ZONE_LIST=('z1','z2','z3','z4');You can modify only one resource pool parameter at a time. If you modify two parameters at a time, the system returns an error.
obclient> ALTER RESOURCE POOL pool1 unit='unit1', zone_list=('HANGZHOU_1'); ERROR 1235 (0A000): alter unit_num, resource_unit, zone_list in one cmd not supported