Key斗篷正在忽略--db-url选项



我试图将我的Key斗篷服务器与Postgres集成,但遇到了一个奇怪的问题。当在Ubuntu上使用提供的命令启动我的密钥斗篷服务器时:

./kc.sh start-dev --http-port ${PORT} --db-url=jdbc:postgres://myurl.com/database --db=postgres --db-schema auth --db-username postgres --db-password password

我得到以下错误:

[org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

当然,如上所示,我的数据库不在localhost上,我相应地设置了--db-url选项。这让我觉得keycloft忽略了--db-url,因为localhost:5432是Postgres连接的默认值。

有人知道为什么会发生这种事吗?

编辑:运行Keycloft 19.0.1版

JDBC应该是:

--db-url=jdbc:postgresql://myurl.com/database

不是:

--db-url=jdbc:postgres://myurl.com/database

最新更新