我创建了一个带有两个副本集的分片。每个副本集都有 3 个mongod
服务器,它们工作正常。此外,mongos
服务器似乎工作。这是它的状态:
mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
"currentVersion" : 4,
"clusterId" : ObjectId("51c5be46dda9b0a5cd83ad64")
}
shards:
{ "_id" : "s1", "host" : "s1/RemotePC_1:27017,RemotePC_1:27018,RemotePC_1:27019" }
{ "_id" : "s2", "host" : "s2/RemotePC_2:27017,RemotePC_2:27018,RemotePC_2:27019" }
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "student", "partitioned" : true, "primary" : "s1" }
student.grades
shard key: { "_id" : 1 }
chunks:
s1 1
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : s1 { "t" : 1, "i" : 0 }
但是,当我在集合上运行任何命令(插入、查找、计数、mongoimport)时,student.grades
我会收到此错误:
mongos> db.grades.count()
Sat Jun 22 20:07:00.968 JavaScript execution failed: count failed: {
"code" : 10429,
"ok" : 0,
"errmsg" : "exception: setShardVersion failed host: RemotePC_2:27017 { oldVersion: Timestamp 0|0, oldVersionEpoch: ObjectId
('000000000000000000000000'), errmsg: \"exception: all servers down/unreachable when querying: My-PC:57017,My-PC:57018,My-PC:57019\", code: 8002, ok: 0.0 }"
} at src/mongo/shell/query.js:L180
为什么?我错过了什么吗?