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

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

      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.

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

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