Skip to content

DOCS-4828 auth fix #2228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions source/tutorial/change-hostnames-in-a-replica-set.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,33 @@ This procedure uses the above :ref:`assumptions <procedure-assumption-change-ho

mongo --port 37017

#. **If** :ref:`authorization` **is active**, log in as a user with
the :authrole:`userAdminAnyDatabase` role and issue the
following commands to create a user role capable of modifying
the ``local.system.replset`` collection:

.. code-block:: javascript

db.runCommand(
{ createRole: "replsetRole",
privileges: [
{ resource: {db: "local", collection: "system.replset" },
actions: [ "find", "update", "remove" ]
}
],
roles: []
}
);

Once this role is created, grant the role to a user:

.. code-block:: javascript

db.grantRolesToUser( "<username>", [ { role: "replsetRole", db: "admin" } ] );

and log in as that user. You may grant the role to the user
being used to create the role, if appropriate.

#. Edit the replica set configuration manually. The replica set
configuration is the only document in the ``system.replset``
collection in the ``local`` database. Edit the replica set
Expand Down