描述
使用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版本开始支持。
示例
mysql> show proxyroute;
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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 |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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; |
| 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; |
| 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; |
| 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; |
| 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; |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
5 rows in set (0.00 sec)
mysql> show proxyroute like '%';
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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 |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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; |
| 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; |
| 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; |
| 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; |
| 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; |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
5 rows in set (0.00 sec)
mysql> show proxyroute like 'MetaDataBase';
+--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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 |
+--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
| 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; |
+--------------+-------------+---------------+-------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+----------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show proxyroute like 'ob1.jianhua.sjh sy_ oceanba% ob_all_%';
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
| 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 |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
| 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; |
| 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; |
| 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; |
+-----------------+-------------+---------------+-------------------------+-------+---------------+-------------+---------------+-----------------+---------------------+---------------------+---------------------+---------------------+---------------------------------+
3 rows in set (0.00 sec)
mysql> show proxyroute like 'ob1.jianhua.sjh sy_ oceanba% ob_all_proxy_vip';
Empty set (0.00 sec)