Spring Cloud Dataflow使用H2数据库

时间:2019-11-25 11:40:57

标签: spring postgresql spring-boot spring-cloud-dataflow

我尝试通过此连接将Postgresql与Spring云数据流一起使用:

java -jar spring-cloud-dataflow-server-2.2.2.BUILD-SNAPSHOT.jar --spring.datasource.url=jdbc:postgresql://localhost:5432/test --spring.datasource.username=postgres --spring.datasource.password=root --spring.datasource.driver-class-name=org.postgresql.Driver

,但未考虑此参数。

我是Spring Cloud数据流的新手。

1 个答案:

答案 0 :(得分:0)

您与我如何使用Postgres凭据启动SCDF之间的唯一区别是,URL的值部分用单引号引起来了。

启动Postgres:

  

docker run --name test-postgres -d -p 5432:5432 -e POSTGRES_PASSWORD = spring -e POSTGRES_USER = spring -e POSTGRES_DB = dataflow postgres:10

启动SCDF:

  

java -jar spring-cloud-dataflow-server / target / spring-cloud-dataflow-server-2.3.0.BUILD-SNAPSHOT.jar --spring.datasource.url ='jdbc:postgresql:// localhost: 5432 / dataflow'--spring.datasource.username = spring --spring.datasource.password = spring --spring.datasource.driverClassName = org.postgresql.Driver

日志: (查找“ Postgres”)

2019-11-25 14:55:57.884  INFO 93574 --- [           main] o.s.c.d.a.l.ProfileApplicationListener   : Setting property 'spring.cloud.kubernetes.enabled' to false.
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| '_ \| '__| | '_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \ \
 | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \ \
 | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

Spring Cloud Data Flow Server  (v2.3.0.BUILD-SNAPSHOT)

2019-11-25 14:55:58.055  INFO 93574 --- [           main] o.s.c.d.s.s.DataFlowServerApplication    : The following profiles are active: local
2019-11-25 14:55:59.133  INFO 93574 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!

...
...
...

2019-11-25 14:56:02.429  INFO 93574 --- [           main] o.f.c.internal.database.DatabaseFactory  : Database: jdbc:postgresql://localhost:5432/dataflow (PostgreSQL 10.11)

...
...

2019-11-25 14:56:03.804  INFO 93574 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2019-11-25 14:56:05.324  INFO 93574 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2019-11-25 14:56:05.336  INFO 93574 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-11-25 14:56:06.596  INFO 93574 --- [           main] o.s.b.c.r.s.JobRepositoryFactoryBean     : No database type set, using meta data indicating: POSTGRES
2019-11-25 14:56:06.658  INFO 93574 --- [           main] o.s.c.d.s.b.SimpleJobServiceFactoryBean  : No database type set, using meta data indicating: POSTGRES

...
...

2019-11-25 14:56:08.037  INFO 93574 --- [           main] o.s.c.d.s.s.DataFlowServerApplication    : Started DataFlowServerApplication in 12.809 seconds (JVM running for 13.754)