这个SQL能查询Region IS_LEADER所在节点信息,去掉 c.IS_LEADER
=‘1’就可以了:
SELECT DISTINCT a.db_name,a.TABLE_NAME,a.REGION_ID,c.STORE_ID,b.ADDRESS FROM INFORMATION_SCHEMA.TIKV_REGION_STATUS a ,INFORMATION_SCHEMA.TIKV_STORE_STATUS b,INFORMATION_SCHEMA.TIKV_REGION_PEERS c
WHERE
– c.IS_LEADER='1’AND
c.STORE_ID=b.STORE_ID
AND a.REGION_ID=c.REGION_ID
AND table_name=‘b’
order by a.REGION_ID
1 个赞