An OceanBase cluster consists of several zones. A zone is usually an independent physical deployment unit, which can be an Internet Data Center (IDC), a node in a cloud, or an independent rack. You can deploy your OceanBase cluster across different zones to implement fault isolation and quick recovery when a zone fails.
Procedure
Log on to the
systenant of the cluster as therootuser.Run the following command to log on. You must replace the related information in the command based on the actual database environment.
obclient -h10.xx.xx.xx -P2883 -uroot@sys -p***** -AFor more information about how to connect to OceanBase Database, see Overview of the Connect to OceanBase Database chapter in Develop Applications in MySQL Mode and Overview of the Connect to OceanBase Database chapter in Develop Applications in Oracle Mode.
Query the
oceanbase.DBA_OB_ZONESview for information about zones in the cluster.obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_ZONES; +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ | ZONE | CREATE_TIME | MODIFY_TIME | STATUS | IDC | REGION | TYPE | +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ | zone1 | 2022-12-20 17:50:17.168745 | 2022-12-20 17:50:40.801054 | ACTIVE | HZ0 | hangzhou | ReadWrite | | zone2 | 2022-12-20 17:50:17.168745 | 2022-12-20 17:50:40.809504 | ACTIVE | HZ0 | hangzhou | ReadWrite | | zone3 | 2022-12-20 17:50:17.169804 | 2023-01-11 17:28:57.211079 | ACTIVE | HZ1 | hangzhou | ReadWrite | | zone4 | 2023-01-06 15:30:30.887362 | 2023-01-06 15:30:30.888420 | INACTIVE | hz1 | hangzhou | ReadWrite | +-------+----------------------------+----------------------------+----------+-----+----------+-----------+ 4 rows in setFields in the query result are as follows:
ZONE: the name of the zone.STATUS: the status of the zone. Valid values:ACTIVE:The zone is available.INACTIVE: The zone is unavailable. The client detects this state and routes the business workflow to another zone.For a new zone or a zone on which you have run an isolation command (Stop Zone, Force Stop Zone, or Isolate Zone), its status will change to
INACTIVE. This situation usually occurs during fault isolation or O&M changes.
IDC: the name of the IDC where the zone is located.REGION: the region where the zone is located. The value is usually a city name such as Shanghai or a region name such as East China.TYPE: the type of the zone.ReadWriteindicates that the zone is a read-write zone. The current database version supports only read-write zones.
For more information about the
oceanbase.DBA_OB_ZONESview, see oceanbase.DBA_OB_ZONES.
More information
For more zone-related O&M operations, see the following topics: