在部署部署manager service这一步报错,求助!

  • Choerodon平台版本: 0.14

  • 环境信息(如:节点信息): k8s v1.13.4

  • 执行命令:
    helm install c7n/manager-service
    –set preJob.preInitDB.datasource.url=“jdbc:mysql://c7n-mysql.c7n-system.svc:3306/manager_service?useUnicode=true&characterEncoding=utf-8&useSSL=false”
    –set preJob.preInitDB.datasource.username=choerodon
    –set preJob.preInitDB.datasource.password=aaaaaa666
    –set env.open.SPRING_DATASOURCE_URL=“jdbc:mysql://c7n-mysql.c7n-system.svc:3306/manager_service?useUnicode=true&characterEncoding=utf-8&useSSL=false”
    –set env.open.SPRING_DATASOURCE_USERNAME=choerodon
    –set env.open.SPRING_DATASOURCE_PASSWORD=aaaaaa666
    –set env.open.SPRING_CLOUD_CONFIG_ENABLED=true
    –set env.open.SPRING_CLOUD_CONFIG_URI=“http://register-server.c7n-system:8000/
    –set env.open.CHOERODON_GATEWAY_DOMAIN=“api.aaa.com
    –set env.open.CHOERODON_SWAGGER_OAUTH_URL=“http://api.aaa.com/oauth/oauth/authorize
    –set env.open.EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=“http://register-server.c7n-system:8000/eureka/
    –set env.open.SPRING_REDIS_HOST=c7n-redis.c7n-system.svc
    –set env.open.SPRING_REDIS_PORT=6379
    –set env.open.SPRING_REDIS_DATABASE=1
    –name manager-service
    –version 0.14.0
    –namespace c7n-system

  • 报错日志:
    2019-03-06 19:19:39.152 ERROR 8 — [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.

java.sql.SQLException: null, message from server: “Host ‘172.20.10.213’ is not allowed to connect to this MySQL server”
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1040) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2236) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2035) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_181]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_181]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) ~[mysql-connector-java-5.1.41.jar!/:5.1.41]
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:310) ~[tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203) ~[tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:735) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:667) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:482) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.(ConnectionPool.java:154) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) [tomcat-jdbc-8.5.14.jar!/:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) [tomcat-jdbc-8.5.14.jar!/:na]
at io.choerodon.liquibase.LiquibaseExecutor.runToDb(LiquibaseExecutor.java:170) [choerodon-liquibase-0.9.0.RELEASE.jar!/:0.9.0.RELEASE]
at io.choerodon.liquibase.LiquibaseExecutor.execute(LiquibaseExecutor.java:84) [choerodon-liquibase-0.9.0.RELEASE.jar!/:0.9.0.RELEASE]
at io.choerodon.liquibase.StartupRunner.run(StartupRunner.java:21) [classes!/:0.9.0.RELEASE]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.5.3.RELEASE.jar!/:1.5.3.RELEASE]
at io.choerodon.liquibase.LiquibaseTools.main(LiquibaseTools.java:18) [classes!/:0.9.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [choerodon-tool-liquibase.jar:0.9.0.RELEASE]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [choerodon-tool-liquibase.jar:0.9.0.RELEASE]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [choerodon-tool-liquibase.jar:0.9.0.RELEASE]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [choerodon-tool-liquibase.jar:0.9.0.RELEASE]

我发现前面创建mysql时传入的root密码并未生效,直接进入mysql的pod,不用密码就能登陆,我手动设置了密码后,在 创建数据库这一步报错如下:

kubectl -n c7n-system logs create-c7nfw-db-njslt
Error from server (BadRequest): container “create-c7nfw-db” in pod “create-c7nfw-db-njslt” is waiting to start: PodInitializing

Hi, Mysql如果root密码未设置成功的,默认配置mysql是起不来的,你是否已经修改过配置?ps: PodInitializing表示正在初始化,初始化时你不能这样拿日志。

等了很久,初始化的job观察是不成功的,发现用heml装这些基础组件不是太美好,原来我gitlab都是按自己的方式部署好了,却又载在这mysql上,早知道mysql也按自己的方式来部署了,嗨,暂时搁置下吧,等你们完善点再弄了,其实挺看好你们这个项目的,只是没想到基础部署这一波X折,好歹你们这些涉及的基础组件我都在公司生产环境维护了大半年了。

兄弟你这太关键了,我说怎么按文档上的password登不进去,妈的原来就没密码!mysql正常启动,后面的脚本我准备把密码去了重新执行下