Overview
Displays the replica distribution information of log stream (LS) for the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| CREATE_TIME | datetime(6) | NO | Creation Time |
| MODIFY_TIME | datetime(6) | NO | Modified At |
| LS_ID | bigint(20) | NO | Log Stream ID |
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
| SQL_PORT | bigint(20) | NO | SQL Port Number |
| ZONE | varchar(128) | NO | Zone Name |
| ROLE | varchar(8) | NO | Replica role:
|
| MEMBER_LIST | varchar(4480) | NO | List of replica members, separated by commas for multiple replicas:
|
| PAXOS_REPLICA_NUMBER | bigint(20) | NO | Quorum of Paxos replicas: When the role is LEADER This field is valid when the parameter is specified; otherwise, it is set to NULL |
| REPLICA_TYPE | varchar(18) | NO | Replica type:
|
| LEARNER_LIST | longtext | YES | The list of read-only replicas for the current log stream, with multiple replicas separated by commas. The display format for a single replica is svr_ip:svr_port:timestamp:flag. Where:
Display example: 172.xx.xxx.xxx:2882:1:0 |
| REBUILD | varchar(5) | NO | Whether the replica is undergoing rebuild |
Sample query
View the distribution information of log stream replicas for this tenant. The sys tenant has only one log stream, which is numbered 1.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_LS_LOCATIONS;
The query result is as follows:
+----------------------------+----------------------------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
| CREATE_TIME | MODIFY_TIME | LS_ID | SVR_IP | SVR_PORT | SQL_PORT | ZONE | ROLE | MEMBER_LIST | PAXOS_REPLICA_NUMBER | REPLICA_TYPE | LEARNER_LIST | REBUILD |
+----------------------------+----------------------------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
| 2024-09-04 09:47:44.144634 | 2024-09-04 09:47:44.144634 | 1 | 172.xx.xxx.xxx | 2882 | 2881 | zone1 | LEADER | 172.xx.xxx.xxx:2882:1 | 1 | FULL | | FALSE |
+----------------------------+----------------------------+-------+----------------+----------+----------+-------+--------+-----------------------+----------------------+--------------+--------------+---------+
1 row in set