You can use the ALTER TENANT statement to remove a resource pool from a tenant.
The SQL syntax for removing a resource pool from a tenant is as follows:
ALTER TENANT tenant_name RESOURCE_POOL_LIST [=](pool_name [, pool_name...]) ;
Statement description:
This statement can only be executed by the administrator of the
systenant.For
RESOURCE_POOL_LIST, only one resource pool can be deleted at a time.
Removing resource pools from a tenant usually happens when you want to reduce the number of replicas for a tenant.
Background information
Assume that the cluster has five zones, z1, z2, z3, z4, and z5, all of which belong to the same region. Each zone has one OBServer node. The cluster has a common tenant named tenant1. The current replica distribution is locality='F@z1,F@z2,F@z3,F@z4,F@z5', resource_pool_list=('pool1','pool2'). The resource distribution of the resource pools is 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').
According to business requirements, you need to reduce the number of replicas of tenant1 from 5 to 3 and reduce the number of resource pools from 2 to 1. The locality of the tenant becomes locality='F@z1,F@z2,F@z3,', resource_pool_list=('pool1').
Procedure
Log in to the
systenant of the cluster using therootuser.Modify the locality of the
tenant1tenant to remove replicas.Based on the locality modification rule, you can directly change the locality to
F@z1,F@z2,F@z3,F@z4,F@z5when the number of replicas increases from 3 to 5. For more information about the locality modification rule, see Modify locality.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
For other scenarios where you need to adjust the available resources for a tenant, you can modify the configuration and number of resource units in the resource pools.
- For instructions on modifying resource unit configurations, see Modify a unit config.
- For instructions on modifying the number of resource units in a resource pool, see Modify attributes of a resource pool.