|
In the procedure for restoring a sharded cluster step 5 states:
"If shard hostnames have changed, update the config database.
If shard hostnames have changed, connect a mongo shell to the mongos instance and update the shards collection in the Config Database to reflect the new hostnames."
I believe an example will make this step clear. For example:
Get the current configuration:
use config
|
db.shards.find()
|
A typical output would be as follows:
{ "_id" : "shard01", "host" : "shard01/oldHost1:27018,oldHost1:27018,oldHost1:27018" }
|
Finally, updating the document with the new hosts:
db.shards.update({_id:"shard01"},{$set:{"host":"shard01/newHost1:27018,newHost2:27018,newHost3:27018"}})
|
|