【发布时间】:2019-09-09 15:14:07
【问题描述】:
我(不能)在 Heroku 上运行我的应用程序。它在本地运行但在云上运行良好。我不明白真正的原因。
- 云MongoDB集群
- Heroku 上的 Spring Boot 应用
application.properties:
spring.data.mongodb.uri=mongodb+srv://demo-user:demo@demo-******u.mongodb.net/test?retryWrites=true&w=majority&serverSelectionTimeoutMS=60000&connectTimeoutMS=60000
spring.data.mongodb.database=test
Heroku 控制台日志:
2019-09-09T14:56:51.741370+00:00 app[web.1]: 2019-09-09 14:56:51.741 INFO 4 --- [ main] org.mongodb.driver.cluster : No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@7d9d0818 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=demo-carp*****u.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, ServerDescription{address=demo-carpool-shard-00-00-hrjju.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, ServerDescription{address=demo-ca*****rjju.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]}. Waiting for 60000 ms before timing out
【问题讨论】:
标签: mongodb spring-boot heroku