Vasu Tubati
Vasu Tubati

Reputation: 31

mongos status is not showing any shard and adding shards also getting failed

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..

Upvotes: 0

Views: 1948

Answers (1)

joeytwiddle
joeytwiddle

Reputation: 31257

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.

Upvotes: 0

Related Questions