收藏
回答

服务部署使用云托管的数据库不能用内网连接?

环境id:prod-5gwccx82ee13ca41;服务名称:supply;版本:supply-004;状态:构建失败

使用云托管自带的数据库内网ip+端口连接就部署不成功,需要在哪里配置才能是服务使用内网连接数据库?

回答关注问题邀请回答
收藏

1 个回答

  • 串儿姐
    串儿姐
    2022-02-22

    数据库使用内网ip就会导致构建失败,其实是因为使用内网ip时你的test模块会运行失败或超时,导致总体构建时间超过10分钟,构建失败。还是建议去除test流程,不要放在构建阶段去做测试。

    2022-02-22
    有用
    回复 2
    • zyx
      zyx
      2022-02-22
      2022-02-22 08:03:27,592[ERROR][/]c.a.d.p.DruidDataSource|create connection SQLException, url: jdbc:mysql://10.0.224.14:3306/supply_chain_pay?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=round&transformedBitIsBoolean=true&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8, errorCode 0, state 08001
      java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
       at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
       at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
       at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
       at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
       at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
       at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)
       at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)
       at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
       at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
       at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
      Caused by: com.mysql.cj.exceptions.CJException: CynosDB serverless instance is resuming, please try connecting again
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
       at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
       at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
       at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
       at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129)
       at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:787)
       at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:712)
      2022-02-22 08:03:49,897[DEBUG][/]c.y.g.s.SpringContextHolder|Inject ApplicationContext to SpringContextHolder:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6bdf28bb, started on
      2022-02-22
      回复
    • zyx
      zyx
      2022-02-22
      这个是连不上吧
      2022-02-22
      回复
登录 后发表内容
问题标签