Limitations
If a tenant already has replicas in all zones of the cluster, you cannot create more replicas.
Background
SQL syntax for creating a resource unit
CREATE RESOURCE UNIT unitname
MAX_CPU [=] cpunum,
[MIN_CPU [=] cpunum,]
MEMORY_SIZE [=] memsize,
[MAX_IOPS [=] iopsnum, MIN_IOPS [=] iopsnum,IOPS_WEIGHT [=]iopsweight,]
[LOG_DISK_SIZE [=] logdisksize];
SQL syntax for creating a resource pool
CREATE RESOURCE POOL poolname
UNIT [=] unitname,
UNIT_NUM [=] unitnum,
ZONE_LIST [=] ('zone' [, 'zone' ...]);
SQL syntax for allocating a resource pool to a tenant
ALTER TENANT tenant_name
RESOURCE_POOL_LIST [=](poolname [, poolname...]);
SQL syntax for adding a replica to a tenant
ALTER TENANT tenant_name LOCALITY [=] 'locality_description';
Procedure
Assume that the tenant1 tenant has only one replica, hosted in zone1, and that you need to create a replica in zone2 for the tenant. Modify the locality of tenant1 to increase the number of replicas.
Log on to the
systenant as therootuser.Create a resource unit.
obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 4, MIN_CPU 4, MEMORY_SIZE '5G', MAX_IOPS 1024, MIN_IOPS 1024, IOPS_WEIGHT 0, LOG_DISK_SIZE '2G';Create a resource pool for zone 2.
obclient> CREATE RESOURCE POOL pool2 UNIT='unit1', UNIT_NUM=1, ZONE_LIST=('zone2');Allocate the resource pool of zone2 to tenant1.
obclient> ALTER TENANT tenant1 resource_pool_list=('pool1','pool2');Add a full-featured replica of zone2 to tenant1.
obclient> ALTER TENANT tenant1 locality='F@zone1,F@zone2';