Reputation: 1326
I have created cluster with 2 shards. Please check my shards status below.
shards:
{ "_id" : "shard0000", "host" : "172.20.1.66:27021" }
{ "_id" : "shard0001", "host" : "172.20.1.66:27022" }
balancer:
Currently enabled: yes
Currently running: no
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
No recent migrations
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "symfony", "partitioned" : false, "primary" : "shard0000" }
{ "_id" : "testDB", "partitioned" : true, "primary" : "shard0001" }
testDB.products
shard key: { "_id" : "hashed" }
chunks:
shard0001 2
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong(0) } on : shard0001 Timestamp(1, 0)
{ "_id" : NumberLong(0) } -->> { "_id" : { "$maxKey" : 1 } } on : shard0001 Timestamp(1, 1)
I have inserted more than 100000 docs and tried to fetch data using query.
db.products.find();
It is returning error as shown below.
Error: error: {
"$err" : "setShardVersion failed shard: shard0001:172.20.1.66:27022 { oldVersion: Timestamp 0|0, oldVersionEpoch: ObjectId('000000000000000000000000'), ns: \"testDB.products\", version: Timestamp 1000|1, versionEpoch: ObjectId('5668170dbd53962a250383f8'), globalVersion: Timestamp 0|0, globalVersionEpoch: ObjectId('000000000000000000000000'), reloadConfig: true, ok: 0.0, errmsg: \"could not refresh metadata for testDB.products with requested shard version 1|1||5668170dbd53962a250383f8, stored shard version is 0|0||00000000000000...\" }",
"code" : 10429,
"shard" : "shard0001"
}
Can some one help me to resolve this issue.
Upvotes: 3
Views: 798
Reputation: 34671
I have seen this error happening when some of the servers could not contact the config servers. Please make sure:
mongos
instance can contact the config server(s).mongod
instances can contact the config server(s).Also, look into the logs of all servers in your setup and look for errors.
Upvotes: 4