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

Change Hostnames (replset) requires special privileges when auth is enabled

    XMLWordPrintableJSON

Details

    Description

      RE: http://docs.mongodb.org/manual/tutorial/change-hostnames-in-a-replica-set/#replica-set-change-hostname-downtime

      We need to cover the possibility of auth being enabled. Switching it off might not be viable (or palatable to some) so there are some extra instructions needed prior to step 3.b:

      // Create a role that has the privileges to find/update/remove documents from local.system.replset collection.
      db.runCommand(
       { createRole: "replsetRole",
        privileges: [
          { resource: { db: "local", collection: "system.replset" },
            actions: ["find","update","remove"] } ],
        roles: []
      } );
      // Grant this new role to user "username".
      db.grantRolesToUser( "username", [ { role: "replsetRole", db: "admin" } ] ); 

      This grants the necessary privileges to "username" to modify local.system.replset.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 9 weeks ago