[英]Flyway cannot connect to db after Heroku Postgres upgrade
我正在将我的heroku数据库从业余开发者升级到标准0(使用官方说明https://devcenter.heroku.com/articles/upgrading-heroku-postgres-databases#upgrade-with-pg-copy-default )。
一切顺利,直到我升级了新数据库并重新启动了该应用程序。 然后,我得到以下错误:
o.s.boot.SpringApplication : Application startup failed
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
...
Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
...
Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "54.xxx.xx.xxx", user "u94bf9vxxxxxx", database "d2mqk0b6xxxxxx", SSL off
...
如果我再次交换回旧数据库,一切将再次正常。 我唯一要更改的是升级后的数据库。
我需要了解的兴趣爱好数据库和标准数据库之间有区别吗?
我的application.yml的相关部分如下所示:
spring:
datasource:
driverClassName: org.postgresql.Driver
url: ${JDBC_DATABASE_URL}
username: ${JDBC_DATABASE_USERNAME}
password: ${JDBC_DATABASE_PASSWORD}
flyway:
enabled: true
locations: classpath:db/migrations
任何有关如何调试此方法的建议也将非常受欢迎。
看起来您没有在Heroku PostgreSQL安装所需的地方连接SSL。
请参阅有关PostgreSQL的SSL的 Herokus 文档 。
另请参见Herokus 文档,以在JDBC连接上启用SSL 。
您将需要在JDBC URL中添加&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.