Homework 1.5:Enabling Mixed Authentication Mechanisms

the validate script return

{ unauthorizedStatus: {“ok”:0,“errmsg”:“not authorized on admin to execute command { replSetGetStatus: 1.0 }”,“code”:13}, memberStatuses: [“PRIMARY”,“SECONDARY”,“SECONDARY”], users: 2019-01-14T22:06:53.302+0000 E QUERY [thread1] Error: error: { “ok” : 0, “errmsg” : “not master and slaveOk=false”, “code” : 13435 } : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DBCommandCursor@src/mongo/shell/query.js:689:1 DBQuery.prototype._exec@src/mongo/shell/query.js:118:28 DBQuery.prototype.hasNext@src/mongo/shell/query.js:276:5 DBQuery.prototype.toArray@src/mongo/shell/query.js:325:12 @(shell eval):7:22 }

what0s wrong???’

@ Mariagiulia_58222

The last part of your return is an error message, and it’s telling you that you are not authorized correctly – basically, that’s what “not master and slaveOK=false” means in this context. For this exercise, that suggests pretty strongly that you have not yet correctly set up your users in the admin database. Remember that this Lab requires mixed authentication. Good luck.

I don’t understand why is not working. Here my steps:

  1. I create replica set first without any aurhentication method
  2. then I startup mongod with keyfile and sslmode
  3. I logon to the primary and create the user ‘will’ and then I create with db.siblingDB($external) the user for the client.pem certificate.

All is working, but rhe script doesn’t validate my work…