You can modify a resource pool to scale in or out resources for tenants. For example, you can modify the UNIT_NUM parameter to increase or decrease the number of nodes in each zone.
Modify a resource pool by using an SQL statement
The syntax for modifying a resource pool is as follows:
ALTER RESOURCE POOL pool_name
UNIT [=] unit_name,
UNIT_NUM [=] unit_num [DELETE UNIT = (unit_id_list)],
ZONE_LIST [=] ('zone'[, 'zone' ...]);
Some notes about this:
This statement can be executed only by the administrator of the
systenant.You can run the SQL 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.When you attempt to reduce the value of
UNIT_NUM, useDELETE UNITto specify the units to be deleted. IfDELETE UNITis not specified, the system automatically selects the units to be deleted.Notice
When you use
DELETE UNITto specify theunit_idparameters of the units to be deleted, the following conditions must be met:In the
unit_idlist, the number of units to be deleted from each zone must be the same. If different numbers of units are to be deleted from the zones in the list, the scale-in operation is invalid.In the
unit_idlist, the number of units to be deleted from each zone must be the same as the value of theUNIT_NUMparameter
You can query the
gv$unitview forunit_idof the units to be deleted.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, MAX_MEMORY '36G', MIN_MEMORY '36G', MAX_IOPS 128, MIN_IOPS 128, MAX_DISK_SIZE '2T', MAX_SESSION_NUM 64;
obclient> CREATE RESOURCE POOL pool1 UNIT 'unit1', UNIT_NUM 2, ZONE_LIST ('z1','z2','z3');
Here are some examples of modifying the resource pool:
Replace resource unit
unit1of resource poolpool1withunit2.obclient> CREATE RESOURCE UNIT unit2 MAX_CPU 8, MAX_MEMORY '40G', MAX_IOPS 128, MAX_DISK_SIZE '10G', MAX_SESSION_NUM 64, MIN_CPU=8, MIN_MEMORY='40G', MIN_IOPS=128; obclient> ALTER RESOURCE POOL pool1 unit='unit2';Change the number of resource units in each zone of resource pool
pool1to 1, without specifyingunit_id.obclient>ALTER RESOURCE POOL pool1 UNIT_NUM = 1;Delete resource units whose
unit_idvalues are1001,1003, and1005from resource poolpool1so that one resource unit is retained in each zone.obclient> ALTER RESOURCE POOL pool1 UNIT_NUM 1 DELETE UNIT = (1001,1003,1005);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 parameter of a resource pool at a time. If you attempt to modify two parameters of a resource pool 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
Modify a resource pool in OCP
Log on to the OCP console.
In the left-side navigation pane, click Tenants.
In the Tenants list, find the tenant whose resource pool is to be modified and click the tenant name.
In the Replica Details area on the Overview page, find the zone whose resource pool is to be modified and click Edit in the Actions column.
Modify the unit specifications and unit quantity of the zone and then click OK.
