简体   繁体   中英

mongo uri for springboot get request

I have configure mongo uri in property file as below,

spring.data.mongodb.uri=mongodb://db1.dev.com,db2.dev.com,db3.dev.com
spring.data.mongodb.database=mydb

I use mongoowl as a monitoring tool. When i do a get request, it shows hits in every mongodb which ideally should be show only in one db right?

不,您实际上是在打开集群副本集连接,在这种连接类型中,spring实际上会连接到所有3个数据库以维护故障转移条件或完全填充“从辅助读取”选项(因此您会在所有3个数据库上看到命中),但是但是,除非已将其指定为从辅助目录读取,否则读取和写入操作仅在主目录上发生。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM