You can add or delete a zone by using an SQL statement.
You can add a zone to a cluster to scale out the cluster or delete a zone from a cluster to scale in the cluster.
Add a zone
Sample statement:
ALTER SYSTEM ADD ZONE zone_name [zone_option_list];
zone_option_list:
zone_option [, zone_option ...]
zone_option:
| region
| idc
| zone_type ReadWrite
Notes:
This statement can be executed only in the
systenant.zone_namespecifies the name of the zone to be added. This statement adds only one zone at a time.zone_option_listspecifies the attributes of the zone. Separate multiple attributes with commas (,).Attributes of a zone:
region: the name of the region where the zone is located. If this attribute is not specified, the default valuedefault_regionis used.idc: the name of the IDC where the zone is located. If the attribute is not specified, it is empty by default.zone_type: the type of the zone. Default value:ReadWrite. Ifzone_typeis not specified, the zone is a read/write zone by default.
Notice
The current version does not support the modification of the
zone_typeattribute. Therefore, you must specify thezone_typeattribute when you add a zone.After you add a zone to a cluster by using the
ALTER SYSTEM ADD ZONE zone_name;statement, you must add OBServer nodes, allocate resources, and add replicas to the zone before you can use it in the cluster.For more information about how to add zones to a cluster to scale out the cluster, see Add a zone to a cluster.
Example: Add zone1 to the cluster
obclient> ALTER SYSTEM ADD ZONE zone1;
Delete a zone
Sample statement:
ALTER SYSTEM DELETE ZONE zone_name;
Notes:
This statement can be executed only in the
systenant.zone_namespecifies the name of the zone to be deleted. This statement deletes only one zone at a time.Before you delete a zone, make sure that no OBServer node is deployed in the zone. Otherwise, the deletion will fail.
Example: Delete zone1 from the cluster
obclient> ALTER SYSTEM DELETE ZONE zone1;