I am trying to shutdown one of the mongodb instance in a 3 node replica set. The config file has auth set to 1. I have a admin account that has userAdminAnyDatabase role and I logged to admin database with that account. However when I run db.shutdownServer() I get the following error
db.shutdownServer() assert failed : unexpected error: "shutdownServer failed: unauthorized" Error: Printing Stack Trace at printStackTrace (src/mongo/shell/utils.js:37:15) at doassert (src/mongo/shell/assert.js:6:5) at assert (src/mongo/shell/assert.js:14:5) at DB.shutdownServer (src/mongo/shell/db.js:346:9) at (shell):1:4 Mon Jun 23 12:52:51.839 assert failed : unexpected error: "shutdownServer failed: unauthorized" at src/mongo/shell/assert.js:7
I created another user that has both dbAdminAnyDatabase and userAdminAnyDatabase roles and that also gets the same error.
Can someone help me with this error?