在PCF上部署时,SCDF V1.6.0-RELEASE不断崩溃

时间:2018-08-23 10:25:34

标签: spring-cloud-dataflow

我要求将计划的任务迁移到SCDF中集成的PCF Scheduler。当开始使用清单文件应用程序进行部署时,由于与数据库连接相关的错误消息而不断崩溃。我正在使用用户定义的服务连接到MySQLDB。

2018-08-23 06:02:18.624 INFO 14 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-08-23 06:02:18.756 INFO 14 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-08-23 06:02:19.432 INFO 14 --- [ main] o.s.c.s.r.PooledDataSourceCreator : Found HikariCP on the classpath. Using it for DataSource connection pooling.
2018-08-23 06:02:19.782 INFO 14 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-08-23 06:02:20.913 ERROR 14 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:173) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1107) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:502) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:155) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.Driver.connect(Driver.java:86) ~[mariadb-java-client-2.2.5.jar!/:na]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117) ~[HikariCP-3.1.0.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:367) ~[HikariCP-3.1.0.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:196) ~[HikariCP-3.1.0.jar!/:na]


Caused by: java.sql.SQLException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:854) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.handleConnectionPhases(AbstractConnectProtocol.java:777) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:451) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1103) ~[mariadb-java-client-2.2.5.jar!/:na]
... 82 common frames omitted

2018-08-23 06:02:20.916 WARN 14 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:339) ~[spring-jdbc-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:366) ~[spring-jdbc-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:72) ~[spring-boot-autoconfigure-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:139) [spring-boot-autoconfigure-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]


Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:326) ~[spring-jdbc-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
... 69 common frames omitted

Caused by: java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:173) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1107) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:502) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:155) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.Driver.connect(Driver.java:86) ~[mariadb-java-client-2.2.5.jar!/:na]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117) ~[HikariCP-3.1.0.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:367) ~[HikariCP-3.1.0.jar!/:na]
... 70 common frames omitted

Caused by: java.sql.SQLException: Access denied for user 'username'@'myappdomain.com' (using password: YES)
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:854) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.handleConnectionPhases(AbstractConnectProtocol.java:777) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:451) ~[mariadb-java-client-2.2.5.jar!/:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1103) ~[mariadb-java-client-2.2.5.jar!/:na]
... 82 common frames omitted

清单文件:

applications:
- name: dataflow-server
  host: dataflow-server
  memory: 2G
  path: spring-cloud-dataflow-server-cloudfoundry-1.6.0.RELEASE.jar
  buildpack: java_buildpack_offline
  env:
    SPRING_APPLICATION_NAME: dataflow-server
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_URL: MY_CLOUDFOUNDRY_URL
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_ORG: MY_ORG
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SPACE: MY_SPACE
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_DOMAIN: MY_DOMAIN
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_USERNAME: USERNAME
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_PASSWORD: SECRET
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION: false
    SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_BUILDPACK: java_buildpack_offline
  services: 
  - RabbitMQ
  - mysql-service

这与我以前的V1.3.0-RELEASE版本中使用的清单相同,并且按预期工作。

1 个答案:

答案 0 :(得分:0)

从1.5开始,我们将连接池机制切换为由Hikari管理。 Spring Boot也将其默认切换。可以从spring-cloud/spring-cloud-dataflow#2169spring-cloud/spring-cloud-dataflow-server-cloudfoundry#417spring-cloud/spring-cloud-dataflow-server-cloudfoundry#415中找到有关其原因的更多背景信息。

有了此支持,您可以通过声明性配置控制池的大小-请参见here

除了用于自定义的新配置属性外,我们无需在v1.5及更高版本中进行任何设置。

最好回顾一下cf push以来的整个堆栈跟踪,直到出现错误为止。另外,您可以编辑该帖子,以包括您在VCAP_SERVIVCES中看到的scdf-server环境。可能是由于CUP服务对数据源凭据的JSON解析格式与spring-cloud-connector可以解释的格式不同,而我们内部依赖。{p>