I have my mongod.cfg located in /etc and i can run mongod -f “/etc/mongod.cfg”
I start mongo --port 27000
then use admin
i try to recreate the users just to check if they exist (from lab1)
i just keep getting the below errors …
Below is the snippet of all the commands and the errros i get
MongoDB Enterprise > 'mongo admin --host localhost:27000 --eval ’
mongo admin --host localhost:27000 --eval
MongoDB Enterprise > db.createUser({
… user: “m103-admin”,
… pwd: “m103-pass”,
… roles: [
… {role: “root”, db: “admin”}
… ]
… })
'2019-10-21T06:31:09.354+0000 E QUERY [thread1] Error: couldn’t add user: there are no users authenticated :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1437:15
@(shell):1:1
MongoDB Enterprise > use admin
switched to db admin
MongoDB Enterprise > db.createUser({
… user: “m103-admin”,
… pwd: “m103-pass”,
… roles: [
… {role: “root”, db: “admin”}
… ]
… })
2019-10-21T06:31:36.738+0000 E QUERY [thread1] Error: couldn’t add user: there are no users authenticated :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1437:15
@(shell):1:1
MongoDB Enterprise > validate_lab_configuration_file
2019-10-21T06:32:04.654+0000 E QUERY [thread1] ReferenceError: validate_lab_configuration_file is not defined :
@(shell):1:1