Purpose
This statement is used to manage the status of a zone, including adding, deleting, starting, stopping, and isolating zones.
Note
This statement can only be executed 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. Before deleting a zone, make sure that it has no available servers. |
| ISOLATE ZONE | Isolates a faulty zone. This operation switches the leader of the faulty zone to another server to restore user write services and restore normal log synchronization within the cluster. |
| START | STOP | Starts or stops a zone. |
| FORCE STOP | Forcefully stops a zone. |
| zone_option | Specifies the attributes of the target zone. If you specify multiple attributes, separate them with commas (,):
|
Examples
Deletes a zone. If the zone contains OBServer nodes, the deletion fails.
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 a faulty zone.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';