odc web 安装失败,提示无法连接metadb

【 使用环境 】测试环境
【 OB or 其他组件 】ODC
【 使用版本 】4.3.3
【问题描述】安装odc web时提示无法连接metadb

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException:
 Could not connect to 192.168.124.128:2881 : (conn=3221710347) Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:83) ~[spring-jdbc-5.3.26.jar!/:5.3.26]
        at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:52) ~[spring-jdbc-5.3.26.jar!/:5.3.26]
        at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.runScripts(DataSourceScriptDatabaseInitializer.java:90) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.runScripts(AbstractScriptDatabaseInitializer.java:145) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:107) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applySchemaScripts(AbstractScriptDatabaseInitializer.java:97) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:75) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.26.jar!/:5.3.26]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.26.jar!/:5.3.26]
        ... 41 more

日志1


docker 容器中环境变量 2

docker容器中直接访问元库 3

1 个赞

有两个问题

  1. 请不要使用 sys租户进行测试 ,任何情况下都不要使用
  2. 看下参数 ob_tcp_invited_nodes
  3. 看下 用户 select host,user from mysql.user;
1 个赞

现在的启动命令:
docker run -v /var/log/odc:/opt/odc/log -v /var/data/odc:/opt/odc/data
-d -i --net host --name “odc”
-e “DATABASE_HOST=192.168.124.128”
-e “DATABASE_PORT=2881”
-e “DATABASE_USERNAME=root@ocp_meta#myoceanbase”
-e “DATABASE_PASSWORD=’^FAwfWf[COom*)+5oJ2ZC:I1o^eQ41’”
-e “DATABASE_NAME=odc_metadb”
-e “ODC_ADMIN_INITIAL_PASSWORD=‘R%7A1k%8Qh2a4’”
oceanbase/odc:4.3.3_bp2

1. 已经切换到root@ocp_meta#myoceanbase 租户
2.
image

3.
image

报错依旧之前的

please check configuration then restart odc-server

[2025-03-27 10:22:12.699 CST][main][,,][ERROR][com.oceanbase.odc.server.config.BeanCreateFailedAnalyzer][32]: bean create failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource 
[org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLSyntaxErrorException: Could not connect to 192.168.124.128:2881 : (conn=3221712820) Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)

image

别写集群名字试下 。 您的上次的测试 没写集群名。
image


参考官网建议 创建个新租户当作元数据库吧

不加,试了,一样的报错

我试了,测试环境资源不足,没法创建其他租户了,用ocp的租户,应该也不影响, 4C10G的环境

image
那么这个密码 是否有空格 , 中文双引号 , 您哪里能改成 123456 这些简单的试下不 ?

没有中文符号,我重新规划了测试资源,然后新建了租户,设置了简单密码就可以了,确实不能加 单引号,英文的也不可以

我重新规划了测试资源,然后新建了租户,现在可以了,谢谢!

1 个赞