描述

    使用show proxyroute [like 'cluster [tenant [db [table]]]']语句:

    • proxy内部sql路由地址信息以table entry为单位, 每个table entry有集群名+租户名+数据库名+表名组成,不指定表名的sql其table 其内部使用__all_dummy表标记。
    • 该命令用于展示proxy内部table entry状态, 默认不带参数是展示所有的, 支持模糊查询。
    • 当查找不到时, 返回空result set。
    • 该命令从proxy 1.1.0版本开始支持。

    示例

    1. mysql> show proxyroute;
    2. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    3. | cluster_name | tenant_name | database_name | table_name | state | partition_num | replica_num | table_id | cluster_version | create_time | last_valid_time | last_access_time | last_update_time | server addr |
    4. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    5. | ob1.jianhua.sjh | sys | oceanbase | __all_dummy | AVAIL | 1 | 1 | 1099511627911 | 3 | 2016-07-25 17:08:54 | 2016-07-25 17:08:54 | 2016-07-25 17:08:54 | 1970-01-01 08:00:00 | server[0]=10.244.4.27:13201,2; server[1]=10.244.4.28:13203,2; |
    6. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy | AVAIL | 1 | 1 | 1099511677777 | 3 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    7. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_vip_tenant | AVAIL | 1 | 1 | 1099511677781 | 3 | 2016-07-25 16:55:12 | 2016-07-25 16:57:59 | 2016-07-25 16:57:59 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    8. | MetaDataBase | sys | oceanbase | __all_dummy | AVAIL | 1 | 1 | 1099511627911 | 2 | 2016-07-25 17:08:54 | 2016-07-25 17:08:54 | 2016-07-25 17:08:54 | 1970-01-01 08:00:00 | server[0]=10.244.4.27:13201,2; server[1]=10.244.4.28:13203,2; |
    9. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_kv_table | AVAIL | 1 | 1 | 1099511677780 | 3 | 2016-07-25 16:54:51 | 2016-07-25 16:57:49 | 2016-07-25 16:57:49 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    10. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    11. 5 rows in set (0.00 sec)
    12. mysql> show proxyroute like '%';
    13. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    14. | cluster_name | tenant_name | database_name | table_name | state | partition_num | replica_num | table_id | cluster_version | create_time | last_valid_time | last_access_time | last_update_time | server addr |
    15. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    16. | ob1.jianhua.sjh | sys | oceanbase | __all_dummy | AVAIL | 1 | 1 | 1099511627911 | 3 | 2016-07-25 17:09:07 | 2016-07-25 17:09:07 | 2016-07-25 17:09:07 | 1970-01-01 08:00:00 | server[0]=10.244.4.27:13201,2; server[1]=10.244.4.28:13203,2; |
    17. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy | AVAIL | 1 | 1 | 1099511677777 | 3 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    18. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_vip_tenant | AVAIL | 1 | 1 | 1099511677781 | 3 | 2016-07-25 16:55:12 | 2016-07-25 16:57:59 | 2016-07-25 16:57:59 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    19. | MetaDataBase | sys | oceanbase | __all_dummy | AVAIL | 1 | 1 | 1099511627911 | 2 | 2016-07-25 17:09:07 | 2016-07-25 17:09:07 | 2016-07-25 17:09:07 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,2; server[1]=10.244.4.27:13201,2; |
    20. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_kv_table | AVAIL | 1 | 1 | 1099511677780 | 3 | 2016-07-25 16:54:51 | 2016-07-25 16:57:49 | 2016-07-25 16:57:49 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    21. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    22. 5 rows in set (0.00 sec)
    23. mysql> show proxyroute like 'MetaDataBase';
    24. +--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    25. | cluster_name | tenant_name | database_name | table_name | state | partition_num | replica_num | table_id | cluster_version | create_time | last_valid_time | last_access_time | last_update_time | server addr |
    26. +--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    27. | MetaDataBase | sys | oceanbase | __all_dummy | AVAIL | 1 | 1 | 1099511627911 | 2 | 2016-07-25 17:09:21 | 2016-07-25 17:09:21 | 2016-07-25 17:09:21 | 1970-01-01 08:00:00 | server[0]=10.244.4.27:13201,2; server[1]=10.244.4.28:13203,2; |
    28. +--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
    29. 1 row in set (0.00 sec)
    30. mysql> show proxyroute like 'ob1.jianhua.sjh sy_ oceanba% ob_all_%';
    31. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
    32. | cluster_name | tenant_name | database_name | table_name | state | partition_num | replica_num | table_id | cluster_version | create_time | last_valid_time | last_access_time | last_update_time | server addr |
    33. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
    34. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy | AVAIL | 1 | 1 | 1099511677777 | 3 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 2016-07-25 17:08:53 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    35. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_vip_tenant | AVAIL | 1 | 1 | 1099511677781 | 3 | 2016-07-25 16:55:12 | 2016-07-25 16:57:59 | 2016-07-25 16:57:59 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    36. | ob1.jianhua.sjh | sys | oceanbase | ob_all_proxy_kv_table | AVAIL | 1 | 1 | 1099511677780 | 3 | 2016-07-25 16:54:51 | 2016-07-25 16:57:49 | 2016-07-25 16:57:49 | 1970-01-01 08:00:00 | server[0]=10.244.4.28:13203,1; |
    37. +-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
    38. 3 rows in set (0.00 sec)
    39. mysql> show proxyroute like 'ob1.jianhua.sjh sy_ oceanba% ob_all_proxy_vip';
    40. Empty set (0.00 sec)