obd demo后不能连接

【 使用环境 】生产环境 or 测试环境
测试
【 OB or 其他组件 】
ob4.1 obd demo
【 使用版本 】
4.1
【问题描述】清晰明确描述问题
运行obd demo正常, 连接密码错误
【复现路径】问题出现前后相关操作
obd demo
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
【问题现象及影响】
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
[root@hol log]# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
ERROR 1045 (42000): Access denied for user ‘root’@‘xxx.xxx.xxx.xxx’ (using password: YES)
[root@hol log]#
【附件】
ob-demo-err.txt (6.6 KB)

If you want to view detailed obd logs, please run: obd display-trace 3f13f51a-cacf-11ed-8536-0800271a62ac
obd cluster display demo 结果看看
这部分日志发一下

obd cluster display demo 结果返回结果看下?

那个环境我铲了.
重新在线安装,一样的报错.
demo_error.log (2.6 MB)

原因我找到了.
机器原来有安装mysql. mysql的配置文件/etc/my.cnf
有设置

[root@hol ~]# tail /etc/my.cnf

[client]
##user=root
#password=mysql
socket = /data/mysql/mysql_3306/tmp/mysql.sock
[root@hol ~]#
我把user, password注释后,登录正常.

[root@hol ~]# obclient -h192.168.56.7 -P2881 -uroot -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221488016
Server version: OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)

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.

root@192.168.56.7:oceanbase 15:37: >

oceanbase会读取/etc/my.cnf?
能否介绍一下相关文档?
谢谢

和那无关吧,从来没有看到过有这种配置

我也觉得奇怪.

块引用
[root@hol ~]# grep -C 2 client /etc/my.cnf
max_allowed_packet = 64M
prompt=\u@\h:\d \R:\m:\s>
[client]
##user=root
#password=mysql
[root@hol ~]# obclient -h192.168.56.7 -P2881 -uroot -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221488369
Server version: OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)

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.

root@192.168.56.7:oceanbase 16:20: >exit
Bye
[root@hol ~]# vi /etc/my.cn
[root@hol ~]# vi /etc/my.cnf
[root@hol ~]# grep -C 2 client /etc/my.cnf
max_allowed_packet = 64M
prompt=\u@\h:\d \R:\m:\s>
[client]
user=root
password=mysql
[root@hol ~]# obclient -h192.168.56.7 -P2881 -uroot -Doceanbase -A
ERROR 1045 (42000): Access denied for user ‘root’@‘xxx.xxx.xxx.xxx’ (using password: YES)
[root@hol ~]#

ip 改成127.0.0.1试试

一样的
Wait for observer init ok
±--------------------------------------------+
| observer |
±----------±--------±-----±------±-------+
| ip | version | port | zone | status |
±----------±--------±-----±------±-------+
| 127.0.0.1 | 4.1.0.0 | 2881 | zone1 | ACTIVE |
±----------±--------±-----±------±-------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

±-------------------------------------------------------------+
| obagent |
±----------±-------------------±-------------------±-------+
| ip | mgragent_http_port | monagent_http_port | status |
±----------±-------------------±-------------------±-------+
| 127.0.0.1 | 8089 | 8088 | active |
±----------±-------------------±-------------------±-------+
±--------------------------------------------+
| obproxy |
±----------±-----±----------------±-------+
| ip | port | prometheus_port | status |
±----------±-----±----------------±-------+
| 127.0.0.1 | 2883 | 2884 | active |
±----------±-----±----------------±-------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
±-------------------------------------------------+
| prometheus |
±----------------------±-----±---------±-------+
| url | user | password | status |
±----------------------±-----±---------±-------+
| http://127.0.0.1:9090 | | | active |
±----------------------±-----±---------±-------+
±---------------------------------------------------------------+
| grafana |
±----------------------------------±------±----------±-------+
| url | user | password | status |
±----------------------------------±------±----------±-------+
| http://127.0.0.1:3000/d/oceanbase | admin | oceanbase | active |
±----------------------------------±------±----------±-------+
demo running
Trace ID: 886d1390-d425-11ed-a694-0800271a62ac
If you want to view detailed obd logs, please run: obd display-trace 886d1390-d425-11ed-a694-0800271a62ac
[root@hol bin]# obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
ERROR 1045 (42000): Access denied for user ‘root’@‘xxx.xxx.xxx.xxx’ (using password: YES)

去掉/etc/my.cnf 的登录信息可以了.

[root@hol bin]# sed -ir ‘s/^(user)/#\1/g’ /etc/my.cnf
[root@hol bin]# sed -ir ‘s/^(password)/#\1/g’ /etc/my.cnf
[root@hol bin]# grep -A 3 ‘client’ /etc/my.cnf
[client]
#user=root
#password=mysql
socket = /data/mysql/mysql_3306/tmp/mysql.sock
[root@hol bin]# obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 5
Server version: OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)

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.

root@127.0.0.1:oceanbase 10:59: >exit
Bye
[root@hol bin]# obclient -h192.168.56.7 -P2883 -uroot -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 6
Server version: OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)

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.

root@192.168.56.7:oceanbase 10:59: >exit
Bye
[root@hol bin]#