Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9379

Comment on: "manual/tutorial/restore-sharded-cluster.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual, Server

    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!

      Attachments

        Activity

          People

            ravind.kumar Ravind Kumar (Inactive)
            alank Alan K Ho
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 14 weeks, 2 days ago