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

Show example on how to remove nodes using rs.reconfig()

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      In cases where rs.remove() is not available (through driver, or if nodes are down), we don't show any example on how to change the cfg document to remove nodes from the members array and then call rs.reconfig(cfg).

      For example:

      cfg = rs.conf()
      cfg.members.splice(3,1)   // remove 3rd node 
      rs.reconfig(cfg)

      This is just normal javascript syntax and not specific to MongoDB, but it should be shown as an example somewhere, for example on the rs.reconfig() page. The example could be similar to the example given on the Change All Hostnames at the Same Time page.

      Attachments

        Activity

          People

            bgrabar Bob Grabar
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 22 weeks, 6 days ago