遇到问题--mongodb--Prematurely reached end of stream(2)
- UID
- 1066743
|
遇到问题--mongodb--Prematurely reached end of stream(2)
解决方案
解决办法就是设置连接闲置时间,当超过这个闲置时间客户端主动关闭连接,下次使用时重新建立连接,这样可以有效避免连接失效的问题。
新增参数
客户端连接超时设置
spring.data.mongodb.prepare.maxConnectionIdleTime=60000
spring.data.mongodb.prepare.maxConnectionLifeTime=0
spring.data.mongodb.prepare.database=db_report
spring.data.mongodb.prepare.host=192.168.30.11
spring.data.mongodb.prepare.port=28717
#spring.data.mongodb.prepare.username=username
#spring.data.mongodb.prepare.password=password
spring.data.mongodb.prepare.autoConnectRetry=true
spring.data.mongodb.prepare.socketKeepAlive=true
spring.data.mongodb.prepare.socketTimeout=1500
spring.data.mongodb.prepare.maxConnectionIdleTime=60000
spring.data.mongodb.prepare.maxConnectionLifeTime=0 |
|
|
|
|
|