Issue on the final Learning Activity: Big Bank Database Internal Authentication

Trying to complete the last Learning Activity of the course. I followed the steps by adding the keyfile to all 3 conf files, started mongod using associated files, connected to 27006 and trying to do rs.initiate but it gave me an error.

Not sure what went wrong.

{
        "operationTime" : Timestamp(0, 0),
        "ok" : 0,
        "errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: localhost:27007 failed with not authorized on admin to execute command { replSetHeartbeat: \"m150-bigbank\", checkEmpty: true, configVersion: 1, configTerm: 0, hbv: 1, from: \"localhost:27006\", fromId: 0, term: 0, $replData: 1, $clusterTime: { clusterTime: Timestamp(0, 0), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $db: \"admin\" }, localhost:27008 failed with not authorized on admin to execute command { replSetHeartbeat: \"m150-bigbank\", checkEmpty: true, configVersion: 1, configTerm: 0, hbv: 1, from: \"localhost:27006\", fromId: 0, term: 0, $replData: 1, $clusterTime: { clusterTime: Timestamp(0, 0), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $db: \"admin\" }",
        "code" : 74,
        "codeName" : "NodeNotFound",
        "$clusterTime" : {
                "clusterTime" : Timestamp(0, 0),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}

This is the command I used to connect, copied from the activity

mongo admin --host localhost:27001

You mentioned connected to 27006 in first post and in the second you are showing 27001
What the 3 hosts/ports in your replica?

Make sure you connect to correct node and run rs.initiate()

1 Like

Have you started the 3 mongod processes?

Show output of the Linux command

ps -aef | grep [m]ongod

Also share the configuration files that shows the modifications you made.

I copied and pasted all the commands directly. Now it works.

{ “ok” : 1 }
m150-bigbank:OTHER>
m150-bigbank:SECONDARY>
m150-bigbank:PRIMARY>