ZONE

2023-12-25 08:49:41  Updated

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

ALTER, CHANGE, and MODIFY are equivalent. You can use any one of them to modify the region attribute of a zone.

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 (,).
  • region: the name of the region where the zone is located. Default value: default_region.
  • idc: the name of the IDC where the zone is located. This parameter is left empty by default.
  • ZONE_TYPE: the type of the zone. Valid values: READWRITE and ENCRYPTION. If you do not explicitly specify ZONE_TYPE, the zone is a READWRITE zone by default.

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';
    

Contact Us