Purpose
This statement is used to manage the status of a zone, 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
| Parameter | Description |
|---|---|
| ADD ZONE | Adds a zone. |
| {ALTER | CHANGE | MODIFY} ZONE | Modifies the region attribute of a zone.
NoteThe |
| DELETE ZONE | Deletes a zone. Before deleting a zone, make sure that there are no available servers in the zone. |
| ISOLATE ZONE | Isolates a faulty zone. It switches the leader of the faulty zone to another server to restore user write services and restore the normal log synchronization status within the cluster. |
| START | STOP | Starts or stops a zone. |
| FORCE STOP | Forces the offline of a zone. |
| zone_option | Specifies the attributes of the target zone. Separate multiple attributes with commas (,):
|
Examples
Delete 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.Isolate a faulty zone.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';
