You can use the ALTER TENANT statement to remove a resource pool from a tenant.
The syntax is as follows:
ALTER TENANT tenant_name RESOURCE_POOL_LIST [=](pool_name [, pool_name...]) ;
Take note of the following syntax description:
This statement can be executed only by the administrator of the
systenant.This statement can delete only one resource pool specified by
RESOURCE_POOL_LISTat a time.
Usually, you can remove a resource pool from a tenant to decrease the number of replicas of the tenant.
Background information
A cluster spans zones z1, z2, z3, z4, and z5 that belong to the same region, and one OBServer node is deployed in each zone. The cluster has a normal tenant named tenant1. The locality information is locality='F@z1,F@z2,F@z3,F@z4,F@z5', resource_pool_list=('pool1','pool2'), and the resource distribution in the resource pools is defined by CREATE RESOURCE POOL pool1 UNIT 'uc1', UNIT_NUM 1, ZONE_LIST ('z1', 'z2', 'z3') and CREATE RESOURCE POOL pool2 UNIT 'uc2', UNIT_NUM 1, ZONE_LIST ('z4', 'z5').
Based on business needs, the number of replicas of tenant1 needs to be decreased from 5 to 3, and the number of resource pools needs to be decreased to 1. That is, the locality of the tenant needs to be changed to locality='F@z1,F@z2,F@z3,', resource_pool_list=('pool1').
Procedure
Log on to the
systenant of the cluster as therootuser.Modify the locality of
tenant1to delete replicas in z4.Based on the locality modification rule, you can delete only one zone at a time. For more information about the locality modification rule, see Modify locality.
obclient>ALTER TENANT tenant1 LOCALITY='F@z1,F@z2,F@z3,F@z4'; obclient>ALTER TENANT tenant1 LOCALITY='F@z1,F@z2,F@z3';Delete the
pool2resource pool fromz4andz5.obclient>ALTER TENANT tenant1 RESOURCE_POOL_LIST =('pool1') ;
More information
In other scenarios, you can modify the configurations and number of resource units in a resource pool to adjust the resources available for a tenant. For more information about how to modify the configurations of a resource unit, see Modify a unit config. For information about how to modify the number of resource units in a resource pool, see Modify attributes of a resource pool.