How to check which nodes the three replicas of TiDB data are stored on

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何查看tidb三个副本数据分别放在哪些节点

| username: bryanz

[TiDB Usage Environment] Production Environment
[TiDB Version] V7.1.1
[Reproduction Path] None
[Issue Encountered: How to check which nodes the three TiDB replicas are placed on]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: TiDB_C罗 | Original post link

Each node has it, but only the leader will be on one of them. Use SHOW TABLE REGIONS to check.

| username: 裤衩儿飞上天 | Original post link

select REGION_ID, PEER_ID, STORE_ID, IS_LEARNER from INFORMATION_SCHEMA.TIKV_REGION_PEERS where `REGION_ID`=XXXX;

store_id corresponds to the TiKV. You can check the relevant information in the tikv_store_status table or use pd-ctl based on the store_id.

| username: redgame | Original post link

Moderator, this SQL works…

| username: bryanz | Original post link

Thank you, boss.

| username: bryanz | Original post link

Thank you, boss. :face_with_monocle:

| username: cy6301567 | Original post link

Sure, please provide the Chinese text you need translated into English.

| username: cassblanca | Original post link

Saved the SQL provided by the new moderator.

| username: zhanggame1 | Original post link

Learned.

| username: Kongdom | Original post link

If you find the answer helpful, remember to mark it as the best answer :wink:

| username: cy6301567 | Original post link

How to get this regionId?

| username: zhanggame1 | Original post link

Generally, it is to look at a specific table, show table xxxx regions.

| username: cy6301567 | Original post link

Got it, thank you.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.