I have successfully launched the mongod process with port 27000 and the given ip, but can’t add the user. Need help!
vagrant@m103:~$ mongo --port 27000
MongoDB shell version v3.6.14
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“361d0703-7b02-43e2-acce-a59456ab9e28”) }
MongoDB server version: 3.6.14
MongoDB Enterprise > use admin
switched to db admin
MongoDB Enterprise > db.createUser({user: “m103-admin”, pwd: “m103-pass”, roles: [{role: “root”, db: “admin”}]})
2019-08-30T08:34:39.543+0000 E QUERY [thread1] Error: couldn’t add user: not master :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1437:15
@(shell):1:1