1

I made a mistake in my mongo sharding setup - I had an error in my config database string. I tried to clean this up by deleting all the data in the config database servers, and restarting all the mongod services. However, even after restarting mongos I still initially get an error like this,

When I run :

sh.status():

I get :

mongos specified a different config database string : stored : <old string here>

Where is this this string actually being stored? I tried looking for it in the config databases themselves and also the members of the shard, but I can't seem to find it.

1
  • 1
    Mongod/shards cache it in memory. You need to restart them. Jan 20, 2014 at 7:38

1 Answer 1

7

As at MongoDB 2.4, the --configsvr string specified for the mongos servers is also cached in-memory on the shard mongod servers. In order for mongos servers to join a sharded cluster, they must have an identical config string (including order of hostnames).

There is a tutorial in the MongoDB manual to Migrate Config Servers with Different Hostnames which covers the full process, including migrating a config server to a new host (which isn't applicable in your case).

If you are still seeing the "different config database string" error after restarting everything, it's likely that you had a least one rogue mongod or mongos running during the process.

To resolve this error:

  • shut down all the mongod processes (for the shards)
  • shut down the mongos processes
  • restart the mongod processes (for the shards)
  • restart the mongos with the correct --configsvr string
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.