问题现象
使用集群 id,登录报错 reading authorization packet,OBProxy 日志报错 -4152。
[root@e69e01297 log]# mysql -h127.0.0.1 -uroot@sys#obcluster:1707811413 -P2883 -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0
[root@e69e01297 log]# mysql -h127.0.0.1 -uroot@sys#obcluster:0 -P2883 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1980254
Server version: 5.6.25 OceanBase 2.2.77 (r20211210235205-46f61a1b0a27dfa2ea1f65366cbedd77e5c4e785) (Built Dec 11 2021 00:24:34)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> use oceanbase
关键信息
obproxy_error 日志中会打印如下报错。
2024-06-12 14:29:51.548517,AntObproxy,,,,metacluster:sys:,OB_MYSQL,,,COM_LOGIN,,failed,-4152,,2008us,0us,0us,0us,Y0-7F76D4C25DA0,,,,0,,Null value,
2024-06-12 14:30:05.228000,AntObproxy,,,,metacluster:sys:,OB_MYSQL,,,COM_LOGIN,,failed,-4152,,1685us,0us,0us,0us,Y0-7F76D4C25DA0,,,,0,,Null value,
对应的 OBProxy 日志,会同时打印 -4018 如下报错。
[2024-06-12 14:30:05.226588] INFO [PROXY] ob_resource_pool_processor.cpp:2147 [1835][xxxxx-xxxxx] [lt=13] [dc=0] can not find cluster resource, maybe it has not been created yet(cluster_info_key={cluster_name:{config_string:"metacluster"}, cluster_id:100000}, ret=-4018)
[2024-06-12 14:30:05.226600] INFO [PROXY] ob_resource_pool_processor.cpp:2216 [1835][xxxxx-xxxxx] [lt=11] [dc=0] fail to acuqire avail cluster resource in local, will schedule task to create and init new cluster resource(cluster_name=metacluster, cluster_id=100000)
[2024-06-12 14:30:05.226616] INFO [PROXY] ob_resource_pool_processor.cpp:1001 [1835][xxxxx-xxxxx] [lt=6] [dc=0] ObClusterResourceCreateCont::main_handler(event="CLUSTER_RESOURCE_CREATE_EVENT", init_status=0, cluster_name=metacluster, cluster_id=100000, data=0x7f76ac5e24a0)
[2024-06-12 14:30:05.226649] INFO [PROXY] ob_resource_pool_processor.cpp:2288 [1835][xxxxx-xxxxx] [lt=27] [dc=0] will create new cluster resource(cluster_name=metacluster, cluster_id=100000, cr_version=7)
[2024-06-12 14:30:05.227320] INFO [PROXY] ob_proxy_json_config_info.cpp:310 [1835][xxxxx-xxxxx] [lt=12] [dc=0] cluster not exist(cluster_name={config_string:"metacluster"}, master_cluster_id=0, cluster_id=100000, ret=-4018)
[2024-06-12 14:30:05.227340] WARN [PROXY] get_cluster_rs_list (ob_config_server_processor.cpp:273) [1835][Y0-7F76D4C25DA0] [lt=18] [dc=0] fail to get cluster info(cluster_name=metacluster, cluster_id=100000, ret=-4018)
[2024-06-12 14:30:05.227353] INFO [PROXY] ob_resource_pool_processor.cpp:825 [1835][xxxxx-xxxxx] [lt=11] [dc=0] will add INIT_RS task(this=0x7f76d56a2bd0, cluster_name=metacluster, cluster_id=100000)
问题原因
OBProxy 以 rslist 方式启动不支持使用集群 id 进行登录租户,默认的集群 id 为 0。
问题的风险及影响
无法登录 OBServer 租户。
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OBProxy V2.x、V3.x、V4.x 版本。
解决方法
去掉登录串中的集群 id 再登录,或者使用集群 id 为 0 进行登录。