rs.status() { "set-6ren">
gpt4 book ai didi

MongoDB 指南针 "Topology Type: Unknown is not writable"

转载 作者:可可西里 更新时间:2023-11-01 10:13:33 34 4
gpt4 key购买 nike

我已将我的 MongoDB 数据库配置为单节点副本集。我可以通过 api 访问它(向它写入数据),也可以从 shell 访问它:

rs0:PRIMARY> rs.status()
{
"set" : "rs0",
"date" : ISODate("2017-12-18T14:37:13.487Z"),
"myState" : 1,
"term" : NumberLong(1),
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1513607826, 1),
"t" : NumberLong(1)
},
"readConcernMajorityOpTime" : {
"ts" : Timestamp(1513607826, 1),
"t" : NumberLong(1)
},
"appliedOpTime" : {
"ts" : Timestamp(1513607826, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1513607826, 1),
"t" : NumberLong(1)
}
},
"members" : [
{
"_id" : 0,
"name" : "srvlx02:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 14633,
"optime" : {
"ts" : Timestamp(1513607826, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-12-18T14:37:06Z"),
"electionTime" : Timestamp(1513593354, 2),
"electionDate" : ISODate("2017-12-18T10:35:54Z"),
"configVersion" : 1,
"self" : true
}
],
"ok" : 1,
"operationTime" : Timestamp(1513607826, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1513607826, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
rs0:PRIMARY> rs.conf()
{
"_id" : "rs0",
"version" : 1,
"protocolVersion" : NumberLong(1),
"members" : [
{
"_id" : 0,
"host" : "srvlx02:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {

},
"slaveDelay" : NumberLong(0),
"votes" : 1
}
],
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {

},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("5a379a0abe6cad70a6b66c7c")
}
}
rs0:PRIMARY>

但是,当我通过 Compass 连接到它时,它显示拓扑为未知,并且不允许修改/删除集合/数据库。

enter image description here

可能是什么问题?为什么 Compass 无法确定拓扑?不支持单节点副本集特例吗?

感谢任何提示!

MongoDB 版本:3.6.0

MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.0

指南针版本:1.11.1社区版

enter image description here

最佳答案

如果其他人遇到同样的问题,我刚刚在 MongoDB Jira 上找到了关于同样问题的错误报告:https://jira.mongodb.org/browse/COMPASS-3264 .

解决方案是将“副本集名称”字段留空,这样就可以正常工作:)

关于MongoDB 指南针 "Topology Type: Unknown is not writable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47870803/

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