6

I have a MongoDB cluster, I accidentally hosed a shard, I don't have a backup. It's pretty easy to recover the data, but after issuing the removeShard command, it says it's draining. However, the shard is unreachable, and will forever be unreachable (I no longer have access to the cloud IP address, and the data is gone). I just want to tell mongo to forget about the shard forever. Is this possible? i.e. Can you remove a shard from mongo without the config controller having access to it?

3
  • No; at least in versions prior to 2.6. After 2.6 I am not 100% sure. I've had this happen in development thankfully awhile ago. I dropped the collection and recovered the data to it. Here is a MongoDB email group post regarding this topic and your exact challenge. groups.google.com/forum/#!topic/mongodb-user/CiOAjdlMOT8
    – SDillon
    May 5, 2015 at 13:19
  • Another mistake I made, once, was to monkey around in the config database and attempt to remove the shard info that way. I ruined that dev cluster.
    – SDillon
    May 5, 2015 at 13:20
  • Did you try to add a "fake shard"? Create the same replica set and create the sharded collections and use the hosts file to each node to route to it. Then try to remove the shard. If you ruin the config servers i don't think it will be possible.
    – Antonios
    May 7, 2015 at 21:45

1 Answer 1

1

Wiki answer generated from question comments by SDillon

No; at least in versions prior to 2.6. After 2.6 I am not 100% sure.

I've had this happen in development, thankfully a while ago. I dropped the collection and recovered the data to it. Here is a MongoDB email group post regarding this topic and your exact challenge.

Another mistake I made, once, was to monkey around in the config database and attempt to remove the shard info that way. I ruined that dev cluster.

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.