I created a MongoDB sharded cluster with replica set rsa, rsb and rsc. Configuration server replica set is configRS. Initially shard status listed only these shards as primary shard for the sharded databases. But now I can see an other shard "config" listed. Where did this shard come from? What does it mean?
[root@akscentnewtest 1]# mongo --port 27777 --host 172.16.66.74 -u cv_user -p'xxxxx' --authenticationDatabase 'admin' --eval "db.adminCommand( { listDatabases: 1 } )"
MongoDB shell version v3.6.6
connecting to: mongodb://172.16.66.74:27777/
MongoDB server version: 3.6.6
{
"databases" : [
{
"name" : "admin",
"sizeOnDisk" : 147456,
"empty" : false,
"shards" : {
"config" : 147456
}
},
{
"name" : "config",
"sizeOnDisk" : 1228800,
"empty" : false,
"shards" : {
"rsa" : 200704,
"rsb" : 102400,
"rsc" : 118784,
"config" : 806912
}
},
{
"name" : "test",
"sizeOnDisk" : 32768,
"empty" : false,
"shards" : {
"rsb" : 32768
}
}
],
"totalSize" : 1409024,
"totalSizeMb" : 1,
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1565775023, 1),
"signature" : {
"hash" : BinData(0,"vIxGUfXD3ZzE5gkr5wSHDBwJuSg="),
"keyId" : NumberLong("6721659792886071315")
}
},
"operationTime" : Timestamp(1565775023, 1)
}
Shard status
mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"minCompatibleVersion" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("5d4821f8ffb408d9b4ea389a")
}
shards:
{ "_id" : "rsa", "host" : "rsa/172.16.63.8:27000", "state" : 1 }
{ "_id" : "rsb", "host" : "rsb/172.16.66.74:27000", "state" : 1 }
{ "_id" : "rsc", "host" : "rsc/172.16.73.51:27001", "state" : 1 }
active mongoses:
"3.6.6" : 1
autosplit:
Currently enabled: yes
balancer:
Currently enabled: yes
Currently running: yes
Failed balancer rounds in last 5 attempts: 5
Last reported error: Could not find host matching read preference { mode: "primary" } for set rsa
Time of Reported error: Wed Aug 14 2019 15:14:01 GMT+0530 (IST)
Migration Results for the last 24 hours:
No recent migrations
databases:
{ "_id" : "config", "primary" : "config", "partitioned" : true }
config.system.sessions
shard key: { "_id" : 1 }
unique: false
balancing: true
chunks:
rsa 1
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : rsa Timestamp(1, 0)
{ "_id" : "test", "primary" : "rsb", "partitioned" : false }