obd部署ocp问题

环境:
os:ubuntu 2204
ob:4.3.0.1
OceanBase Deploy: 2.7.0

已经用odb黑屏部署observer、obproxy、ocp-express、obagent、obconfigserver等,ocp-express组件正常工作。部署相关配置如下:

现想部署社区版ocp,配置如下:

user:
    username: admin
#   password: your password if need
#   key_file: your ssh-key file path if need
    port: 22
    timeout: 1000
ocp-server-ce:
  servers:
  - 10.xx.xx.126
  global:
    home_path: /data/admin/ocp
    memory_size: 8G
    port: 28080
    soft_dir: /data/admin/ocp/software # Directory used to store packages
    log_dir: /data/admin/ocp/logs # Directory used to temporary store downloaded logs
    admin_password: ObDemo_@123 # Password of ocp's admin user
    jdbc_url: jdbc:oceanbase://10.xx.xx.126:2883/ocp_meta # Jdbc url of meta obcluster
    # OCP meta tenant definition, including tenant name, cpu and memory
    ocp_meta_tenant:
      tenant_name: ocp_meta
      max_cpu: 2.0
      memory_size: 2G
      ocp_meta_username: root # User to use under ocp meta tenant
      ocp_meta_password: ocp_meta # Password used to connect to ocp meta tenant
      ocp_meta_db: meta_database # Database used to store ocp meta data
    # OCP monitor tenant definition, including tenant name, cpu and memory
    ocp_monitor_tenant:
      tenant_name: ocp_monitor
      max_cpu: 2.0
      memory_size: 2G
      ocp_monitor_username: root # User to use under ocp monitor tenant
      ocp_monitor_password: ocp_monitor # Password used to connect to ocp meta tenant
      ocp_monitor_db: monitor_database # Database used to store ocp meta data

报错:

admin@ubuntu:~$ obd cluster start ocp-only                            
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start ocp-server x
[ERROR] failed to connect meta db

See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: c86f75b0-2496-11ef-814c-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace c86f75b0-2496-11ef-814c-c62cc4bad044
[2024-06-07 14:25:50.972] [DEBUG] -- metadb connect check
......
[2024-06-07 14:25:57.000] [DEBUG] -- check cursor failed
[2024-06-07 14:25:58.001] [DEBUG] -- connect 10.xx.xx.126 -P2883 -umeta@ocp_meta -poceanbase
[2024-06-07 14:25:58.004] [DEBUG] -- check cursor failed
[2024-06-07 14:25:59.004] [DEBUG] -- connect 10.xx.xx.126 -P2883 -umeta@ocp_meta -poceanbase
[2024-06-07 14:25:59.007] [DEBUG] -- check cursor failed
[2024-06-07 14:26:00.008] [DEBUG] -- connect 10.xx.xx.126 -P2883 -umeta@ocp_meta -poceanbase
[2024-06-07 14:26:00.011] [DEBUG] -- check cursor failed
[2024-06-07 14:26:01.012] [ERROR] failed to connect meta db
[2024-06-07 14:26:01.012] [DEBUG] -- time check 
[2024-06-07 14:26:01.013] [DEBUG] -- admin@10.xx.xx.126 execute: date +"%Y-%m-%d %H:%M:%S" 
[2024-06-07 14:26:01.020] [DEBUG] -- exited code 0

看报错日志是连ocp meta错误,为什么连接用户是meta@ocp_meta 呢? 并且密码是oceanbase呢?

补充下:

admin@ubuntu:~$ mysql -uroot@ocp_monitor -h10.xx.xx.126 -P2883 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1814094056
Server version: 5.6.25 OceanBase_CE 4.3.0.1 (r100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9) (Built Mar 22 2024 13:07:59)

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| monitor_database   |
| mysql              |
| oceanbase          |
| test               |
+--------------------+
5 rows in set (0.02 sec)

mysql> quit
admin@ubuntu:~$ mysql -uroot@ocp_meta -h10.xx.xx.126 -P2883 -p   
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1814065207
Server version: 5.6.25 OceanBase_CE 4.3.0.1 (r100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9) (Built Mar 22 2024 13:07:59)

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| meta_database      |
| mysql              |
| oceanbase          |
| test               |
+--------------------+
5 rows in set (0.02 sec)

memory_size: 8G 往大设置下呢。比如16G

试了也不行的

obd日志提供下。~/.obd/log/obd

obd部署ocp-only日志.txt (12.7 KB)

完整日志提供下。
这个只能看的到当前执行结果

obd.log.txt (193.5 KB)

怀疑是创建ocp_meta租户时内存不足了。导致未创建上ocp_meta租户。可以调大下memory_limit内存或者创建ocp_meta租户

root@ocp_meta
root@ocp_monitor
这两个用户都能成功连接啊,看我2楼的补充资料
报错日志里面的-umeta@ocp_meta 和 password oceanbase 配置文件压根都没有配过

就是obd部署ocp时,连接meta数据库 为什么没有按yaml文件配置的用户密码连接?

其实,我可以按照obd报错日志里面提示的用户密码去创建用户,应该可以解决,但是想知道原因,为什么没有yaml配置的连接串去连接数据库?

看下obd是多少版本呢 obd --version
如果obd不是最新版本2.9.0 可以升级下


z再部署试试看

我已经用docker方式部署了,但是又卡在凭证无法连接这里。
image

image


这里验证又是可以通过的。

使用docker部署的ocp 可以试下容器的方式进行认证呢。

谢谢,我已经改成私钥方式,问题解决。