Hi,
Is the following supposed to work? I am getting “errmsg” : “there are no users authenticated”. Or was the user not created? At the moment, I am doing mongod --shutdown instead. Please advise.
use admin
db.shutdownServer()
quit()
vagrant@m103:~
vagrant@m103:~ ps -ef | grep mongo
vagrant 3483 1506 0 05:07 pts/0 00:00:04 mongod --config /home/vagrant/config/config_lab.txt
vagrant 3676 1595 0 05:15 pts/1 00:00:00 grep --color=auto mongo
vagrant@m103:~ mongo --port 27000
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("c5c399c8-ebe1-46b6-b2ae-5301fe8b66ca") }
MongoDB server version: 3.6.12
MongoDB Enterprise > use admin
switched to db admin
MongoDB Enterprise > db.shutdownServer()
2019-04-15T05:16:04.716+0000 E QUERY [thread1] Error: shutdownServer failed: {
"ok" : 0,
"errmsg" : "there are no users authenticated",
"code" : 13,
"codeName" : "Unauthorized"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.shutdownServer@src/mongo/shell/db.js:453:1
@(shell):1:1
MongoDB Enterprise > quit
function quit() {
[native code]
}
MongoDB Enterprise > quit()
vagrant@m103:~ mongod --config ~/config/config_lab.txt --shutdown
killing process with pid: 3483
vagrant@m103:~ ps -ef | grep mongo
vagrant 3686 1595 0 05:16 pts/1 00:00:00 grep --color=auto mongo
vagrant@m103:~
vagrant@m103:~$