[DOCS-9379] Comment on: "manual/tutorial/restore-sharded-cluster.txt" Created: 25/Nov/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Alan K Ho Assignee: Ravind Kumar (Inactive)
Resolution: Won't Do Votes: 0
Labels: collector-298ba4e7, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769
Story Points: 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(

{"_id": <oldShardName>}

, {$set:{"host": <newShardName>/CSRS server list and ports> }})

Thanks!



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:58:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.