You can isolate a zone when it fails. In this way, new read or write requests are not routed to processes in the failed zone.
When a zone fails, you can isolate it to switch the leader in the failed zone to another zone, to restore the write service for users and log synchronization in the cluster. After the cluster recovers, run the Stop Zone command to stop the failed zone and then restart it.
Sample statement for isolating a failed zone:
obclient> ALTER SYSTEM ISOLATE ZONE 'zone_name';
This statement can be executed only in the sys tenant.
Example:
Log on to the
systenant of the cluster as therootuser.Execute the following statement to isolate the failed OBServer node.
obclient> ALTER SYSTEM ISOLATE ZONE 'zone1';If the statement succeeds, the failed zone is isolated. In the
oceanbase.DBA_OB_ZONESview, you can find that theSTATUSvalue of the isolated zone isINACTIVE, which indicates that the zone is stopped.Sample statement for checking the
oceanbase.DBA_OB_ZONESview:obclient> SELECT * FROM oceanbase.DBA_OB_ZONES WHERE zone= 'zone1'; +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ | ZONE | CREATE_TIME | MODIFY_TIME | STATUS | IDC | REGION | TYPE | +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ | zone1 | 2022-12-05 17:06:08.483852 | 2022-12-05 17:16:17.459531 | INACTIVE | HZ0 | hangzhou | ReadWrite | +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ 1 row in setFor more information about the fields in the
oceanbase.DBA_OB_ZONESview, see DBA_OB_ZONES.
You can execute the ALTER SYSTEM START ZONE 'zone1' statement to cancel the isolation of a zone.