0
votes

Unable to list shards of replica set from Mongos client..

Mongodb Authentication is enabled in sharded cluster.. in config server, the key got changed so cluster stopped working .. I have restored same key and enabled authentication now.. hence after, i am unable to see the shards which were added earlier and also can't able to add same shard again ..

mongos> sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "minCompatibleVersion" : 5, "currentVersion" : 6, "clusterId" : ObjectId("58bd2f7ea00a1d1ce3806bf3") } shards: active mongoses: "3.2.9" : 1 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:

mongos> sh.addShard("rs01/rs01-p01:27017,rs01-s01:27017,rs01-s02:27017") { "ok" : 0, "errmsg" : "can't add shard 'rs01/rs01-p01:27017,rs01-s01:27017,rs01-s02:27017' because a local database 'config' exists in another config", "code" : 96 } mongos>

can some one please help me what went wrong and how can configserver can get shards information back..

1
Issue resolved.. It is issue with the local config data base created in replica set.Vasu Tubati

1 Answers

0
votes

I had the same. I just had to connect to the server I was trying to add, and drop its config database.

$ mongo rs01-p01:27017
> use config
> db.dropDatabase()

Then on the mongos, I could add the shard as expected.