gpt4 book ai didi

mongodb - 在 mongodb 中找不到匹配读取首选项的主机

转载 作者:可可西里 更新时间:2023-11-01 09:34:51 27 4
gpt4 key购买 nike

我正在分片环境中的新数据库中创建新集合。

coll.insertMany(list) 时出现以下错误。

Exception in thread "main" com.mongodb.MongoCommandException: 
Command failed with error 133: 'unable to target write op for collection dbname.collection:: caused by ::
FailedToSatisfyReadPreference: Could not confirm non-existence of database "dbname" due to inability to query the config server primary :: caused by ::
FailedToSatisfyReadPreference: could not find host matching read preference { mode: "primary" } for set csReplSet' on server ip:27017.
The full response is { "ok" : 0, "code" : 133, "errmsg" : "unable to target write op for collection dbname.collection:: caused by ::
FailedToSatisfyReadPreference: Could not confirm non-existence of database \"dbname\" due to inability to query the config server primary :: caused by ::
FailedToSatisfyReadPreference: could not find host matching read preference { mode: \"primary\" } for set csReplSet" }

最佳答案

看起来阅读偏好给您带来了问题。

请通过阅读偏好设置更适合您的应用

https://docs.mongodb.com/manual/reference/read-preference/

如果您的问题与下面 jira 中提到的问题有关,那么我们需要 mongo 版本 3.3.11,目前我们只有 3.2.9 released。 .

https://jira.mongodb.org/browse/SERVER-22620

关于mongodb - 在 mongodb 中找不到匹配读取首选项的主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39117060/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com