描述
kill proxysession (cs_id | connection_id)
语句kill掉指定cs, 与
kill connection id
一致。id
既可以是cs id,也可以是connection id, 展示结果相同。cs id为proxy内部标记每个client的id号, connection id为整个OceanBase数据库标记每个client的id号。
kill proxysession (cs_id | connection_id) ss_id
语句kill掉指定cs上得server session,该
ss_id
可以从show proxysession attribute id
中获取。id
既可以是cs id,也可以是connection id, 展示结果相同。cs id为proxy内部标记每个client的id号, connection id为整个OceanBase数据库标记每个client的id号。
示例
mysql> show proxysession;
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| 756006681247547400 | 7 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23706 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
1 row in set (0.00 sec)
mysql> kill proxysession 7;
ERROR 1317 (70100): Query execution was interrupted
mysql> show proxysession;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 8
Current database: *** NONE ***
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| 756006681247547401 | 8 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23715 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
1 row in set (0.01 sec)
mysql> select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 2147549203 |
+-----------------+
1 row in set (0.00 sec)
mysql> kill proxysession 2147549203;
ERROR 1317 (70100): Query execution was interrupted
mysql> show proxysession;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 9
Current database: *** NONE ***
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
| 756006681247547402 | 9 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23734 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
1 row in set (0.01 sec)
mysql> show proxysession attribute;
+------------------------+---------------------+----------------+
| attribute_name | value | info |
+------------------------+---------------------+----------------+
| proxy_sessid | 756006681247547402 | cs common |
| cs_id | 9 | cs common |
| cluster | ob1.jianhua.sjh | cs common |
| tenant | sys | cs common |
| user | root | cs common |
| host_ip | 127.0.0.1 | cs common |
| host_port | 23734 | cs common |
| db | NULL | cs common |
| total_trans_cnt | 0 | cs common |
| svr_session_cnt | 1 | cs common |
| active | true | cs common |
| read_state | MCS_ACTIVE_READER | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| modified_time | 1469436154736537702 | cs stat |
| reported_time | 1469436154734045058 | cs stat |
| hot_sys_var_version | 0 | cs var version |
| sys_var_version | 0 | cs var version |
| user_var_version | 0 | cs var version |
| last_insert_id_version | 0 | cs var version |
| db_name_version | 0 | cs var version |
| server_ip | 10.244.4.28 | last used ss |
| server_port | 13203 | last used ss |
| server_sessid | 2147549204 | last used ss |
| ss_id | 10 | last used ss |
| state | MSS_KA_CLIENT_SLAVE | last used ss |
| transact_count | 1 | last used ss |
| server_trans_stat | 0 | last used ss |
| hot_sys_var_version | 0 | last used ss |
| sys_var_version | 0 | last used ss |
| user_var_version | 0 | last used ss |
| last_insert_id_version | 0 | last used ss |
| db_name_version | 0 | last used ss |
+------------------------+---------------------+----------------+
33 rows in set (0.00 sec)
mysql> kill proxysession 9 10;
Query OK, 0 rows affected (0.00 sec)
mysql> show proxysession attribute;
+------------------------+---------------------+----------------+
| attribute_name | value | info |
+------------------------+---------------------+----------------+
| proxy_sessid | 756006681247547402 | cs common |
| cs_id | 9 | cs common |
| cluster | ob1.jianhua.sjh | cs common |
| tenant | sys | cs common |
| user | root | cs common |
| host_ip | 127.0.0.1 | cs common |
| host_port | 23734 | cs common |
| db | NULL | cs common |
| total_trans_cnt | 0 | cs common |
| svr_session_cnt | 0 | cs common |
| active | true | cs common |
| read_state | MCS_ACTIVE_READER | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| modified_time | 1469436218332107523 | cs stat |
| reported_time | 1469436218332175341 | cs stat |
| hot_sys_var_version | 0 | cs var version |
| sys_var_version | 0 | cs var version |
| user_var_version | 0 | cs var version |
| last_insert_id_version | 0 | cs var version |
| db_name_version | 0 | cs var version |
+------------------------+---------------------+----------------+
21 rows in set (0.00 sec)
mysql> select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 2147614732 |
+-----------------+
1 row in set (0.01 sec)
mysql> show proxysession attribute;
+------------------------+---------------------+----------------+
| attribute_name | value | info |
+------------------------+---------------------+----------------+
| proxy_sessid | 756006681247547402 | cs common |
| cs_id | 9 | cs common |
| cluster | ob1.jianhua.sjh | cs common |
| tenant | sys | cs common |
| user | root | cs common |
| host_ip | 127.0.0.1 | cs common |
| host_port | 23734 | cs common |
| db | NULL | cs common |
| total_trans_cnt | 0 | cs common |
| svr_session_cnt | 1 | cs common |
| active | true | cs common |
| read_state | MCS_ACTIVE_READER | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| modified_time | 1469436224790015422 | cs stat |
| reported_time | 1469436224791042749 | cs stat |
| hot_sys_var_version | 0 | cs var version |
| sys_var_version | 0 | cs var version |
| user_var_version | 0 | cs var version |
| last_insert_id_version | 0 | cs var version |
| db_name_version | 0 | cs var version |
| server_ip | 10.244.4.27 | last used ss |
| server_port | 13201 | last used ss |
| server_sessid | 2147614732 | last used ss |
| ss_id | 11 | last used ss |
| state | MSS_KA_CLIENT_SLAVE | last used ss |
| transact_count | 1 | last used ss |
| server_trans_stat | 0 | last used ss |
| hot_sys_var_version | 0 | last used ss |
| sys_var_version | 0 | last used ss |
| user_var_version | 0 | last used ss |
| last_insert_id_version | 0 | last used ss |
| db_name_version | 0 | last used ss |
+------------------------+---------------------+----------------+
33 rows in set (0.00 sec)
mysql> kill proxysession 2147614732 11;
Query OK, 0 rows affected (0.00 sec)
mysql> show proxysession attribute;
+------------------------+---------------------+----------------+
| attribute_name | value | info |
+------------------------+---------------------+----------------+
| proxy_sessid | 756006681247547402 | cs common |
| cs_id | 9 | cs common |
| cluster | ob1.jianhua.sjh | cs common |
| tenant | sys | cs common |
| user | root | cs common |
| host_ip | 127.0.0.1 | cs common |
| host_port | 23734 | cs common |
| db | NULL | cs common |
| total_trans_cnt | 0 | cs common |
| svr_session_cnt | 0 | cs common |
| active | true | cs common |
| read_state | MCS_ACTIVE_READER | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| modified_time | 1469436238254131223 | cs stat |
| reported_time | 1469436238254131223 | cs stat |
| hot_sys_var_version | 0 | cs var version |
| sys_var_version | 0 | cs var version |
| user_var_version | 0 | cs var version |
| last_insert_id_version | 0 | cs var version |
| db_name_version | 0 | cs var version |
+------------------------+---------------------+----------------+
21 rows in set (0.00 sec)