Query all nodes
You can query all OBServer nodes where the binlog service resides.
Syntax
SHOW NODES;
The output is as follows:
+----------------------------------+------------+------+------+--------+-------+--------+---------+------------+
| id | ip | port | zone | region | group | state | metric | heartbeat |
+----------------------------------+------------+------+------+--------+-------+--------+---------+------------+
| 4e944e78db2cbe6c3d5481e267a8c6ef | 10.10.10.1 | 2983 | | | | ONLINE | xxxx | 1735550248 |
+----------------------------------+------------+------+------+--------+-------+--------+---------+------------+
The following table describes the columns in the result set.
| Column | Description |
|---|---|
| id | The ID of the OBServer node. |
| ip | The IP address of the OBServer node. |
| port | The port number of the OBServer node. |
| zone | The zone to which the OBServer node belongs. |
| region | The region to which the OBServer node belongs. |
| group | The group to which the OBServer node belongs. |
| state | The status of the OBServer node. |
| metric | The details about the status of the OBServer node. |
| heartbeat | The timestamp of the last heartbeat. |
Query the node where the primary instance resides
You can query information about the OBServer node where the primary binlog instance of the specified tenant resides. If no primary binlog instance is available, an error message is returned.
Syntax
SHOW BINLOG SERVER FOR TENANT cluster.tenant;
cluster.tenant specifies the name of the tenant to query and the name of the cluster to which the tenant belongs. Here is an example:
SHOW BINLOG SERVER FOR TENANT obdemo.test1;
The output is as follows:
+---------+--------+------------+------+--------+-------+
| cluster | tenant | ip | port | status | cause |
+---------+--------+------------+------+--------+-------+
| obdemo | test1 | 10.10.10.1 | 8103 | OK | NULL |
+---------+--------+------------+------+--------+-------+
The following table describes the columns in the result set.
| Column | Description |
|---|---|
| cluster | The name of the OceanBase cluster. |
| tenant | The name of the tenant in the OceanBase cluster. |
| ip | The IP address of the OBServer node where the binlog instance resides. |
| port | The port number of the OBServer node where the primary binlog instance resides. The value 0 indicates that no service port has been allocated. |
| status | The status of the primary binlog instance, which is fixed to OK at present. |
| cause | Reserved for future use. |