OceanBase部署导致obproxy连接不上

【 使用环境 测试环境
【 OB or 其他组件 】
【 使用版本 】OceanBase4.3.3 ,obproxy4.3.1.0
【问题描述】安装完OceanBase软件后再安装obproxy,然后连接obproxy结果连接失败
【复现路径】安装oceanbase软件包
[root@oceanbase69 oceanbase]# rpm -ivh oceanbase-ce-*
Verifying… ################################# [100%]
准备中… ################################# [100%]
正在升级/安装…
1:oceanbase-ce-libs-4.3.3.0-1000001################################# [ 33%]
execute pre install script
2:oceanbase-ce-4.3.3.0-100000142024################################# [ 67%]
execute post install script
To configure OceanBase : edit /etc/oceanbase.cnf
To start OceanBase : systemctl start oceanbase
To enable OceanBase auto reboot : systemctl enable oceanbase
To get more infomation : https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000640297
3:oceanbase-ce-devel-3.1.5-10002002################################# [100%]

安装obproxy软件包
[root@oceanbase69 oceanbase]# rpm -ivh obproxy-ce-4.3.1.0-4.el7.x86_64.rpm
Verifying… ################################# [100%]
准备中… ################################# [100%]
软件包 obproxy-ce-4.3.1.0-4.el7.x86_64 已经安装
[root@oceanbase69 oceanbase]#

启动observer
cd /hoem/admin/oceanbase
bin/observer -o cluster_id=1 -i ens32 -p 2881 -P 2882 -z zone1 -d ~/oceanbase/store -r ‘172.16.1.69:2882:2881’ -c 1 -n obdemo -o “memory_limit=8G,cache_wash_threshold=1G,__min_full_resource_pool_memory=1073741824,system_memory=1G,memory_chunk_cache_size=128M,cpu_count=16,net_thread_count=4,datafile_size=10G,stack_size=1536K”

配置
obclient -h172.16.1.69 -uroot -P2881 -p -c -A
alter system bootstrap ZONE ‘zone1’ SERVER ‘172.16.1.69:2882’;

启动obproxy
bin/obproxy -r “172.16.1.69:2881” -p 2883 -o “enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false” -c obdemo
查看端口
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:2881 0.0.0.0:* LISTEN 20570/bin/observer
tcp 0 0 0.0.0.0:2882 0.0.0.0:* LISTEN 20570/bin/observer
tcp 0 0 0.0.0.0:2883 0.0.0.0:* LISTEN 21046/bin/obproxy
tcp 0 0 0.0.0.0:2884 0.0.0.0:* LISTEN 21046/bin/obproxy
tcp 0 0 0.0.0.0:2885 0.0.0.0:* LISTEN 21046/bin/obproxy
通过obproxy登录
obclient -h172.16.1.69 -uroot@proxysys -P2883 -p
[admin@oceanbase69 obproxy-4.3.1.0]$ obclient -h172.16.1.69 -uroot@proxysys -P2883 -p
Enter password:
ERROR 1045 (42000): Access denied for user ‘root@proxysys’@‘172.16.1.69’ (using password: NO)

[admin@oceanbase69 obproxy-4.3.1.0]$ obclient -h172.16.1.69 -uroot@proxysys -P2884 -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘handshake: reading initial communication packet’, system error: 11

obclient -h192.168.10.13 -uroot@sys#obcluster -p -P2883 -Doceanbase -A

#obcluster 集群名字 可以通过 2881 进行查看 show parameters like ‘%cluster%’;

[admin@oceanbase69 ~]$ obclient -h172.16.1.69 -uroot@sys#obdemo -p -P2883 -Doceanbase -A
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11

使用rpm安装,在ob创建proxyro用户了么

obclient> CREATE USER proxyro IDENTIFIED BY ‘******’;
Query OK, 0 rows affected

obclient> GRANT SELECT ON . TO proxyro;
Query OK, 0 rows affected

obclient> SHOW GRANTS FOR proxyro;
±---------------------------------+
| Grants for proxyro@% |
±---------------------------------+
| GRANT SELECT ON . TO ‘proxyro’ |
±---------------------------------+
1 row in set

–连接测试
obclient -h192.168.2.21 -P2883 -uroot@sys -Doceanbase -A -p
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11
ALTER USER proxyro IDENTIFIED BY ‘password’; --sys租户登录进行修改

alter proxyconfig set observer_sys_password = ‘password’; --root@proxysys租户登录进行修改 2883端口

是使用observer连接创建proxyro用户,然后再使用obproxy连接吗

[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot -P2881 -p -c -A
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487717
Server version: OceanBase_CE 4.3.3.0 (r100000142024101215-0723f9774e5f77a1253149261ba75a94414625d0) (Built Oct 12 2024 15:58:11)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

obclient [(none)]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘‘1qaz@WSX’’ at line 1
obclient [(none)]>

是的。 -P2881 root@sys登录ob集群。创建proxyro用户

语法问题看一下是不是引号什么的导致

[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot@sys -P2881 -p1qaz@WSX -c -A oceanbase
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487719
Server version: OceanBase_CE 4.3.3.0 (r100000142024101215-0723f9774e5f77a1253149261ba75a94414625d0) (Built Oct 12 2024 15:58:11)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

obclient [oceanbase]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘‘1qaz@WSX’’ at line 1
obclient [oceanbase]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;
Query OK, 0 rows affected (0.152 sec)

obclient [oceanbase]> GRANT SELECT ON . TO proxyro;
Query OK, 0 rows affected (0.059 sec)

obclient [oceanbase]> quit

天极爱了用户,但是使用obproxy连接集群还是连接不上
[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot@sys#obdemo -P2883 -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11

参考下面进入obproxy,密码为proxyro的

配置密码

使用root@proxysys连接,默认密码为空。
[admin@db01 tmp]$ obclient -h 192.168.5.200 -u root@proxysys -P 2883 -p
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.25
MySQL [(none)]> alter proxyconfig set observer_sys_password = ‘SWoLCQRH’ ;
Query OK, 0 rows affected (0.001 sec)

MySQL [(none)]> show proxyconfiglike ‘%password%’;
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
| name | value | info | need_reboot | visible_level |
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
| observer_sys_password | acd251af8f718bac0889a4b1e499fd3b465bfbc2 | password for observer sys user | false | SYS |
| obproxy_sys_password | | password for obproxy sys user | false | SYS |
| inspector_password | | password for inspector user | false | SYS |
| json_config_meta_table_password | | meta table password | true | virtual |
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
4 rows in set (0.000 sec)

问题解决了么