我已将 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 连接到它时,它将拓扑显示为 UNKNOWN,并且不允许修改/删除集合/数据库。
可能是什么问题呢?为什么 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 社区版