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

rs.initiate() needed before db.createUser() using localhost exception if node is fresh replset node

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None
    • 0.5

      The "Add Users After Enabling Access Control" section of /manual/tutorial/enable-authentication/ describes how to create the first user after creating a new node that has auth enabled.

      I think the list of steps should include a new one between the current steps 2 and 3, pointing out if the node has the replSet arg (i.e. it is the first node of new replica set being created) that rs.initiate() will need to be run as the first step, before db.createUser(). If it isn't then no writes will be permitted (the node is not yet a primary), so the db.createUser() command will be refused for that reason.

      Without that caveat users may think the error they see when they run db.createUser() is something they did wrong in regards to options they set or how well they followed our instructions.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            akira.kurogane Akira Kurogane
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 11 weeks, 5 days ago