1 故障现象说明
通过单独部署的 OCP 来接管 OBServer 集群,报如下错误:
OB集群 proxyro 用户密码与 OCP 设置不相同
2 问题过程
在 OBServer 集群在部署过程中有一些可选的参数,我这里并没有配置:
https://www.oceanbase.com/docs/common-oceanbase-database-cn-10000000001692942
其中可选的proxyro_password参数说明如下:
- OBD V2.0.0 及之前版本默认为空,OBD V2.1.0 及之后版本默认为随机字符串
- ODP 连接 OceanBase 集群使用的账户名(proxyro@sys)的密码。使用 OBD V2.1.0 及之后版本时,未设置的情况下会自动生成随机字符串。
我们这里没有设置,所以在 OBD 部署的的时候,proxyro为随机密码。
这里可以通过查询 OBServer 验证:
[dave@www.cndba.cn conf]$obclient -h192.168.1.100 -P2883 -uroot -p'xxxxxxx' -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or /g.
Your OceanBase connection id is 39919
Server version: OceanBase_CE 4.1.0.0 (r101010022023051821-f7379b26f8cd11f026e06846043550f9e0d42ead) (Built May 18 2023 21:14:14)
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]> select user,password from mysql.user;
+-------------+-------------------------------------------+
| user | password |
+-------------+-------------------------------------------+
| root | *7dd15147a6e6f4756d87b10ef844a33ccbb75f2b |
| proxyro | *e9c2bcdc178a99b7b08dd25db58ded2ee5bff050 |
| ocp_monitor | *8f0758d46ed87bbde2dc541a3f3c368ae7e53dfc |
+-------------+-------------------------------------------+
3 rows in set (0.002 sec)
默认的密码值可以通过集群配置文件查看:
[dave@www.cndba.cn ~]$obd cluster edit-config myoceanbase
ocp_agent_monitor_password: KZ3PD17ZcN
proxyro_password: eGcpD994UR
ocp_meta_password: BWzMd0bEDi
ocp_meta_tenant_log_disk_size: 7G
enable_syslog_recycle: true
enable_syslog_wf: false
max_syslog_file_count: 4
这里报错侧原因是因为 OCP 中也有proxyro 用户,并且默认情况下,该用户的密码为空。
[dave@www.cndba.cn ~]# obclient -h172.21.122.31 -P2883 -uroot -p'xxxxxxx' -Doceanbase -AWelcome to the OceanBase. Commands end with ; or /g.
Your OceanBase connection id is 2098209
Server version: OceanBase_CE 4.1.0.0 (r100000172023031416-6d4641c7bcd0462f0bf3faed011803c087ea1705) (Built Mar 14 2023 16:53:58)
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]> select user,password from mysql.user;
+---------+-------------------------------------------+
| user | password |
+---------+-------------------------------------------+
| root | *7dd15147a6e6f4756d87b10ef844a33ccbb75f2b |
| proxyro | |
+---------+-------------------------------------------+
2 rows in set (0.020 sec)
obclient [oceanbase]>
3 解决方法
虽然 OCP 中proxyro 的密码为空,但不代表没有密码,在没有设置密码的情况下,会使用默认密码:"3u^0kCdpE"
进行连接。
所以在 OBServer 端重新设置proxyro 用户的密码为 OCP 的默认密码即可:
obclient [oceanbase]> alter user proxyro identified by "3u^0kCdpE";
版权声明:本文为博主原创文章,未经博主允许不得转载。