Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
MongoS version 3.2.10, 64-bit OSX 10.11.6
git version: 79d9b3ab5ce20f51c272b4411202710a082d0317
OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
*Location*: https://docs.mongodb.com/manual/tutorial/restore-sharded-cluster/#restore-sh-cl-dmp
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
*Referrer*: https://www.google.ca/
*Screen Resolution*: 1440 x 900
MongoS version 3.2.10, 64-bit OSX 10.11.6 git version: 79d9b3ab5ce20f51c272b4411202710a082d0317 OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016 *Location*: https://docs.mongodb.com/manual/tutorial/restore-sharded-cluster/#restore-sh-cl-dmp *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36 *Referrer*: https://www.google.ca/ *Screen Resolution*: 1440 x 900
-
2.5
Description
Following this guide, when I got to step 9 I needed to update the hostname for the new shard. However, following Step 8 and Step 9 here didn't quite work and I kept getting error that said mongodb couldn't reach the new shard host.
mongos> show dbs
2016-11-24T17:53:21.497-0800 E QUERY [thread1] Error: listDatabases failed:{
"code" : 71,
"ok" : 0,
"errmsg" : "None of the hosts for replica set b could be contacted."
I am using mongodb 3.2.10
After doing this a few times, I realized that updating shard hostnames should be done after Step 7, before starting any mongos instances (Step 8). This means that one must update the hostname in the config database by connecting to CSRS Config Server Primary. I performed this workaround and my sharded cluster finally restored correctly. I would also recommend maybe you could provide an quick example of code snippet on how to change the hostname in the config database for shards, as described below:
cfgServer> use config
cfgServer> db.shards.update(
, {$set:{"host": <newShardName>/CSRS server list and ports> }})
Thanks!