Purpose
This statement is used to manage the status of zones, including operations such as 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
Parameters |
Description |
|---|---|
| ADD ZONE | Add a zone. |
| {ALTER \ | CHANGE \ | MODIFY} ZONE | Modifies the region attribute of a zone.
Note
|
| DELETE ZONE | Before deleting a zone, ensure that there are no available servers in the zone. |
| ISOLATE ZONE | Isolate the faulty zone. Switch the leader from the faulty zone to another machine to restore user write services and normalize log synchronization within the cluster. |
| START \ | STOP | Proactively add or remove zones. |
| FORCE STOP | Forced offline zone. |
| zone_option | Specify the attributes of the target zone. When specifying multiple attributes, separate them with commas (,):
|
Examples
Deleting a zone fails if the zone contains OBServer nodes.
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 the faulty zone.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';