Purpose
You can use this statement to maintain the status of zones in the system and control the add, delete, start, stop, and isolate operations on the zones.
Note
This statement can be executed 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 the 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.Isolates the failed zone.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';