Hi there:
I’m trying to create the user the same way we did in the first lab and I get this error:
vagrant@m103:~$ mongo admin --host localhost:27000 --eval 'db.createUser({user: "m103-application-user", pwd: "m103-application-pass", roles: [{role: "readWrite", db: "applicationData"}]})'
MongoDB shell version v3.6.14
connecting to: mongodb://localhost:27000/admin?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("cc24ddd0-75df-44a5-b7b0-44c02adb5c4d") }
MongoDB server version: 3.6.14
2019-09-27T09:06:11.034+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 eval):1:1
This is my mongod.conf
:
net:
bindIp: "192.168.103.100,localhost"
port: 27000
operationProfiling:
mode: "slowOp"
slowOpThresholdMs: 50
processManagement:
fork: true
security:
authorization: enabled
storage:
dbPath: "/var/mongodb/db/"
systemLog:
destination: "file"
logAppend: true
path: "/var/mongodb/db/mongod.log"