[英]connect Spring Cloud DataFlow and Postgresql-db by docker-compose
I tryed to configure containerization by using the following docker-compose.yaml:我尝试使用以下 docker-compose.yaml 配置容器化:
services:
postgresql:
image: postgres:13.1
container_name: dataflow-postgresql
environment:
POSTGRES_DB: test_source
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpw
expose:
- 5433
dataflow-server:
image: springcloud/spring-cloud-dataflow-server
container_name: dataflow-server
ports:
- "9393:9393"
depends_on:
- postgresql
skipper-server:
image: springcloud/spring-cloud-skipper-server
container_name: skipper
ports:
- "7577:7577"
- ${APPS_PORT_RANGE:-20000-20105:20000-20105}
Containers successfully runs.容器成功运行。
In dataflow I create stream with standart jdbc-application.在数据流中,我使用标准 jdbc 应用程序创建 stream。 In url-option I use:
在 url-option 我使用:
jdbc:postgresql://postgresql:5433/test_source
Database is exist.数据库存在。
In postgresql.conf I prescribe port 5433 (to prevent conflict with 5432 at localhost-postgresql).在 postgresql.conf 中,我指定了端口 5433(以防止与 localhost-postgresql 中的 5432 发生冲突)。
For docker-connectin I use default.net.对于 docker-connectin,我使用 default.net。
As a result I gain in logs:结果我获得了日志:
at org.springframework.boot.jdbc.AbstractDataSourceInitializer.initialize(AbstractDataSourceInitializer.java:53) ~[spring-boot-2.1.13.RELEASE.jar!/:2.1.13.RELEASE]
According to documentation, in string 53 of this class:根据文档,在这个 class 的字符串 53 中:
return false;
in method:在方法中:
private boolean isEnabled() {
if (this.getMode() == DataSourceInitializationMode.NEVER) {
return false;
} else {
return this.getMode() != DataSourceInitializationMode.EMBEDDED || EmbeddedDatabaseConnection.isEmbedded(this.dataSource);
}
}
What am I doing wrong?我究竟做错了什么?
The problem solved by settind the value "org.postgresql.Driver" to property "driver-class-name"通过将值“org.postgresql.Driver”设置为属性“driver-class-name”解决了这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.