Purpose
You can use this statement to add, modify, delete, start, stop, or isolate a zone.
Note
You can execute this statement only in the sys tenant.
Syntax
alter_system_zone_stmt:
ALTER SYSTEM zone_action;
zone_action:
ADD ZONE zone_name
[zone_option_list]
| {ALTER | CHANGE | MODIFY} ZONE zone_name
[SET] zone_option_list
| {DELETE | START | STOP | FORCE STOP} ZONE zone_name
| ISOLATE ZONE '$zone_name';
zone_option_list:
zone_option [, zone_option ...]
zone_option:
region
| idc
| ZONE_TYPE {READWRITE | ENCRYPTION}
idc:
STR_VALUE
Parameters
| Parameter | Description |
|---|---|
| ADD ZONE | Adds a zone. |
| {ALTER | CHANGE | MODIFY} ZONE | Modifies the region attribute of a zone.
Note
|
| DELETE ZONE | Deletes a zone. Ensure that the zone to be deleted does not contain any server. |
| ISOLATE ZONE | Isolates a failed zone. The leader in the failed zone is moved to another server to resume the user write service and log synchronization within the cluster. |
| START | STOP | Starts or stops a zone. |
| FORCE STOP | Force stops a zone. |
| zone_option | The attributes of the zone. Separate multiple attributes with commas (,).
|
Examples
Delete a zone. The deletion fails because the zone contains an OBServer node.
obclient> ALTER SYSTEM DELETE ZONE 'z1'; ERROR 4668 (HY000): The zone is not empty and can not be deleted. You should delete the servers of the zone. There are 1 servers alive and 0 not alive.Isolate a failed zone.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';