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.Note that you must specify the corresponding options 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 setColumns in the query result are described as follows:
ZONE: the name of the zone.STATUS: the status of the zone. Valid values include: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, orIsolate Zone), its status will change toINACTIVE. 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.
References
For more zone-related O&M operations, see the following topics: