An OceanBase cluster consists of several zones. A zone is usually an independent physical deployment unit, which can be an IDC, a zone 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 in to the
systenant of the cluster as therootuser.Note that you must specify the corresponding parameters in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more information about how to connect to a database, see Connection methods (MySQL mode) or Connection methods (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 described 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. When the client detects this state, it routes the business workflow to another zone.For a new zone or a zone on which you have run an isolation command such as
STOP ZONE,FORCE STOP ZONE, orISOLATE ZONE, its state isINACTIVE. This state 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.TYPE: the type of the zone.ReadWriteindicates that the zone is a read-write zone. The current database version supports only read-write zones.
References
For more information about zone-related O&M operations, see the following topics: