obd部署之后没法用proxy连接

【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】4.3.4
【问题描述】清晰明确描述问题
【复现路径】问题出现前后相关操作

查看proxy日志有报错
[2024-11-15 08:33:39.532990] INFO [PROXY.SS] new_connection (ob_mysql_server_session.cpp:106) [21649][Y0-00007F2DC8DCE710] [lt=0] [dc=0] server session born(ss_id=52382, server_ip={192.168.1.203:2881}, cs_id=1387271596, proxy_sessid=0, server_type=1)
[2024-11-15 08:33:39.533212] INFO [PROXY.TXN] handle_handshake_pkt (ob_mysql_transact.cpp:5226) [21649][Y0-00007F2DC8DCE710] [lt=0] [dc=0] succ to set proxy_sessid(cs_id=1387271596, proxy_sessid=13882347818653568158, server_ip={192.168.1.203:2881}, ss_id=52382, server_sessid=3221778178, is_proxy_mysql_client=true, ss_fd=151, client_addr=“192.168.1.202:39958”)
[2024-11-15 08:33:39.535747] WDIAG [PROXY.SM] print_mysql_complete_log (ob_mysql_sm.cpp:6134) [21649][Y0-00007F2DC8DCE710] [lt=0] [dc=0] finishing mysql tunnel(finishing mysql tunnel(sm_id=59618, cs_id=1387271596, proxy_sessid=13882347818653568158, ss_id=52382, server_sessid=3221778178, client_ip={Not IP address [0]:0}, server_ip={192.168.1.203:2881}, server_trace_id=, proxy_user_name=proxyro@sys#myoceanbase, database_name=, is_flow_controlled=false, cpu_flow_control_count=0, memory_flow_control_count=0, sql=, sql_cmd=“Login”, result={is_trans_completed:true, is_resp_completed:true, ending_type:2, is_partition_hit:true, has_new_sys_var:false, has_proxy_idc_name_user_var:false, is_server_db_reset:false, reserved_ok_len_of_mysql:0, reserved_ok_len_of_compressed:0, connection_id:0, scramble_buf:"", is_resultset_resp:false, server_capabilities_lower_.capability:0, ok_packet_action_type:2, last_ok_pkt_len:12, rewritten_last_ok_pkt_len:0, extra_info:{is_exist_sess_info:false, sess_info_count:0, extra_len:0}, error_pkt:field_count:255, errcode:1045, sqlstate:“42000”, message:“Access denied for user ‘proxyro’@‘xxx.xxx.xxx.xxx’ (using password: YES)”})
[2024-11-15 08:33:39.535843] ERROR [PROXY] do_next_action (ob_client_vc.cpp:885) [21649][Y0-00007F2DC8DCE710] [lt=0] [dc=0] proxyro@sys access denied, please check password(mysql_resp_->get_err_msg()=Access denied for user ‘proxyro’@‘xxx.xxx.xxx.xxx’ (using password: YES), retry_times_=0, ret=0)^C

通过下面配置部署集群,使用2883端口连上使用有问题
obd cluster deploy myoceanbase -c ob.yaml

使用2881两台机都能正常连接

1 个赞

root@proxysys改成root@sys,或者其它租户,proxysys是管理obproxy用的

按我那个配置部署之后,还需要设置什么吗

用obclient或者mysql命令行测试下呢

看proxy日志有错误,连上之后也操作不了

obclient -h192.168.0.20 -P2883 -uroot@sys#ocp -p’123456’ -A 这样呢

报什么错误呢?可以根据楼上的建议黑屏连接测试下是否正常?

[root@localhost ~]# obclient -h192.168.1.202 -P2883 -uroot@sys#myoceanbase -p’Aibao520–’
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11

看obproxy日志里有些错误===>
, role:“FOLLOWER”, type:“FULL”}]}, ret=0)
[2024-11-15 10:59:33.253774] INFO [PROXY.SS] new_connection (ob_mysql_server_session.cpp:106) [21650][Y0-00007F2DC8DD0610] [lt=0] [dc=0] server session born(ss_id=248950, server_ip={192.168.1.202:2881}, cs_id=1387277948, proxy_sessid=0, server_type=1)
[2024-11-15 10:59:33.253909] INFO [PROXY.TXN] handle_handshake_pkt (ob_mysql_transact.cpp:5226) [21650][Y0-00007F2DC8DD0610] [lt=0] [dc=0] succ to set proxy_sessid(cs_id=1387277948, proxy_sessid=13882347818653568118, server_ip={192.168.1.202:2881}, ss_id=248950, server_sessid=3221491381, is_proxy_mysql_client=true, ss_fd=154, client_addr=“192.168.1.202:43276”)
[2024-11-15 10:59:33.256282] WDIAG [PROXY.SM] print_mysql_complete_log (ob_mysql_sm.cpp:6134) [21650][Y0-00007F2DC8DD0610] [lt=0] [dc=0] finishing mysql tunnel(finishing mysql tunnel(sm_id=281522, cs_id=1387277948, proxy_sessid=13882347818653568118, ss_id=248950, server_sessid=3221491381, client_ip={Not IP address [0]:0}, server_ip={192.168.1.202:2881}, server_trace_id=, proxy_user_name=proxyro@sys#myoceanbase, database_name=, is_flow_controlled=false, cpu_flow_control_count=0, memory_flow_control_count=0, sql=, sql_cmd=“Login”, result={is_trans_completed:true, is_resp_completed:true, ending_type:2, is_partition_hit:true, has_new_sys_var:false, has_proxy_idc_name_user_var:false, is_server_db_reset:false, reserved_ok_len_of_mysql:0, reserved_ok_len_of_compressed:0, connection_id:0, scramble_buf:"", is_resultset_resp:false, server_capabilities_lower_.capability:0, ok_packet_action_type:2, last_ok_pkt_len:12, rewritten_last_ok_pkt_len:0, extra_info:{is_exist_sess_info:false, sess_info_count:0, extra_len:0}, error_pkt:field_count:255, errcode:1045, sqlstate:“42000”, message:“Access denied for user ‘proxyro’@‘xxx.xxx.xxx.xxx’ (using password: YES)”})
[2024-11-15 10:59:33.256379] ERROR [PROXY] do_next_action (ob_client_vc.cpp:885) [21650][Y0-00007F2DC8DD0610] [lt=0] [dc=0] proxyro@sys access denied, please check password(mysql_resp_->get_err_msg()=Access denied for user ‘proxyro’@‘xxx.xxx.xxx.xxx’ (using password: YES), retry_times_=0, ret=0)

使用proxyro登陆下看看,proxyro的密码有修改过吗?

可以查看吗,你看一下我上面配置,后面没有修改过

直接登录2881,查看MYSQL用户,只有一个ROOT账号

proxyro 用户不存在

使用 root@sys 用户通过直连的方式进入 OceanBase 数据库,并在 sys 租户下创建 proxyro 用户:

CREATE USER proxyro IDENTIFIED BY 'your_password';  --与observer_sys_password密码保持一致
GRANT SELECT ON *.* TO proxyro;

然后再试下

1 个赞

建了该用户可以了,为什么部署完缺少该用户呢

yaml配置文件中没有写配置项 proxyro_password,可以参考下
https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001429336

我上面配置的两台机器 192.168.1.202,192.168.1.203
若是将 192.168.1.203停了,192.168.1.202那台机还可以访问,
若是将 192.168.1.202停了,则192.168.1.203也访问不了,是哪配置问题吗

203的obproxy进程正常吗?发下这个obproxy.log

直连都不行的

是直连203的obsever不行吗?麻烦发下报错信息