2

I had to replace a mongodb config server in a cluster that contains only 1 shard.

By mistake, I started the new config server without any data and got the following message in the logs:

[CheckConfigServers] ERROR: could not verify that config servers are in sync :: caused by :: config servers configserver1.mydomain.com:27019 and configserver2.mydomain.com:27019 differ

Following the procedure at 'http://docs.mongodb.org/manual/tutorial/replace-config-server/', I tried to stop the balancer from a mongos. But I got an error message. I could only stop the balancer after having restarted the empty configserver.

I copied the dbpath content from configserver2 to configserver1 and everything looks fine.

I'd like to ensure that no data has been misplaced or lost during these operations. With only 1 shard in the cluster, could data be misplaced?

Thanks,

Greg.

Icu
  • 1,495

2 Answers2

3

The CheckConfigServers warning message you received on startup is a sanity check to prevent any metadata changes (eg. chunk migration as a result of a balancing round) from happening while the config servers are in an inconsistent state.

Stopping the config server with the empty dbpath and recopying the data from a known good config server was the correct action to take. The MongoDB config servers are not a replica set, and are kept in sync via two-phase commits coordinated by the mongod/mongos servers in your sharded cluster.

If you only have one shard than data will not be misplaced; there is nowhere for it to have migrated to.

Additionally, if you have enabled sharding but haven't sharded any collections the data will all live on the primary shard.

Stennie
  • 1,300
1

I would think that you should be alright with running the printShardingStatus() command .

gWaldo
  • 12,027