"Run Test" not working : Lab: Deploy a Replica Set

I seem to have an issue when I hit “Run Test”. I have created all 3 nodes and verified them with rs.status() but when I hit “Run Test” it gets stuck on “Testing workspace…” and doesn’t move to the [PASS]/[FAIL] screen.

Is this a bug?

Thank you

Go in the terminal and post a screenshot of running the command:

ps -aef | grep [m]ongo

A bit off topic but I think you meant [mM]ongo ?

Also grep -i mongo but it’s less restrictive.

Here is a screenshot of the command

You think wrong. I meant what I wrote that is grep [m]ongo. The process name does not have an uppercase, so having an uppercase M in the character group is useless. By greping with [m]ongo rather that simply mongo you do not get the grep command in the output. See the difference:

: steevej @ asus-laptop ; ps -aef | grep [m]ongo
steevej  27502   630  0 Jan02 pts/5    00:56:50 mongod

vs

: steevej @ asus-laptop ; ps -aef | grep -i mongo
steevej  14030   630  0 15:42 pts/5    00:00:00 grep -i mongo
steevej  27502   630  0 Jan02 pts/5    00:56:49 mongod

1 Like

You have to set the password to what it is asked for in the lab. By changing the password to xxxxxxxxx the validating script can authenticate and validate the setup.

I’m confused because these are the credentials I logged in with:
mongo --host "localhost:27001" -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin"

I was able to log in successfully, so how did the password change to xxxxxxxxx?

I am unsure what I have to adjust.

I’d restart the workspace with and use this conditions:

  • launch mongod using a configuration file, mongod -f <filename>
  • Do use the keyfile for the servers to authenticate each other.

As they are required. Unless you used it and it’s hidden in the terminal, but it does not seem so.

I believe I am using the keyfile to authenticate. When launching mongod I am using mongod --port 27001 --dbpath /var/mongodb/db/1 --fork --logpath /var/mongodb/logs/mongod1.log --replSet “m103-repl”

This is what I am seeing after typing rs.status()

`{
    "set" : "“m103-repl”",
    "date" : ISODate("2021-01-08T05:49:32.629Z"),
    "myState" : 1,
    "term" : NumberLong(1),
    "syncingTo" : "",
    "syncSourceHost" : "",
    "syncSourceId" : -1,
    "heartbeatIntervalMillis" : NumberLong(2000),
    "optimes" : {
            "lastCommittedOpTime" : {
                    "ts" : Timestamp(1610084961, 1),
                    "t" : NumberLong(1)
            },
            "readConcernMajorityOpTime" : {
                    "ts" : Timestamp(1610084961, 1),
                    "t" : NumberLong(1)
            },
            "appliedOpTime" : {
                    "ts" : Timestamp(1610084961, 1),
                    "t" : NumberLong(1)
            },
            "durableOpTime" : {
                    "ts" : Timestamp(1610084961, 1),
                    "t" : NumberLong(1)
            }
    },
    "lastStableCheckpointTimestamp" : Timestamp(1610084902, 1),
    "members" : [
            {
                    "_id" : 0,
                    "name" : "localhost:27001",
                    "health" : 1,
                    "state" : 1,
                    "stateStr" : "PRIMARY",
                    "uptime" : 314,
                    "optime" : {
                            "ts" : Timestamp(1610084961, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDate" : ISODate("2021-01-08T05:49:21Z"),
                    "syncingTo" : "",
                    "syncSourceHost" : "",
                    "syncSourceId" : -1,
                    "infoMessage" : "",
                    "electionTime" : Timestamp(1610084671, 2),
                    "electionDate" : ISODate("2021-01-08T05:44:31Z"),
                    "configVersion" : 3,
                    "self" : true,
                    "lastHeartbeatMessage" : ""
            },
            {
                    "_id" : 1,
                    "name" : "localhost:27002",
                    "health" : 1,
                    "state" : 2,
                    "stateStr" : "SECONDARY",
                    "uptime" : 17,
                    "optime" : {
                            "ts" : Timestamp(1610084961, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDurable" : {
                            "ts" : Timestamp(1610084961, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDate" : ISODate("2021-01-08T05:49:21Z"),
                    "optimeDurableDate" : ISODate("2021-01-08T05:49:21Z"),
                    "lastHeartbeat" : ISODate("2021-01-08T05:49:31.241Z"),
                    "lastHeartbeatRecv" : ISODate("2021-01-08T05:49:32.249Z"),
                    "pingMs" : NumberLong(0),
                    "lastHeartbeatMessage" : "",
                    "syncingTo" : "localhost:27003",
                    "syncSourceHost" : "localhost:27003",
                    "syncSourceId" : 2,
                    "infoMessage" : "",
                    "configVersion" : 3
            },
            {
                    "_id" : 2,
                    "name" : "localhost:27003",
                    "health" : 1,
                    "state" : 2,
                    "stateStr" : "SECONDARY",
                    "uptime" : 11,
                    "optime" : {
                            "ts" : Timestamp(1610084961, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDurable" : {
                            "ts" : Timestamp(1610084961, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDate" : ISODate("2021-01-08T05:49:21Z"),
                    "optimeDurableDate" : ISODate("2021-01-08T05:49:21Z"),
                    "lastHeartbeat" : ISODate("2021-01-08T05:49:31.247Z"),
                    "lastHeartbeatRecv" : ISODate("2021-01-08T05:49:31.890Z"),
                    "pingMs" : NumberLong(0),
                    "lastHeartbeatMessage" : "",
                    "syncingTo" : "localhost:27001",
                    "syncSourceHost" : "localhost:27001",
                    "syncSourceId" : 0,
                    "infoMessage" : "",
                    "configVersion" : 3
            }
    ],
    "ok" : 1,
    "operationTime" : Timestamp(1610084961, 1),
    "$clusterTime" : {
            "clusterTime" : Timestamp(1610084961, 1),
            "signature" : {
                    "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                    "keyId" : NumberLong(0)
            }
    }

}
`

mongod won’t look around for a file, it needs to be told where that is. Please take a look at the Lab description.

And although that may work, the lab is asking to start mongod using a configuration file instead of the command line.

To put an example:

mongod --host localhost --port 27001
//should be
mongod -f mongod_config1.conf

Where the config file holds the configuration.

I think we just found a nice security feature implemented in mongod. It probably change the command line before the OS register it in order to protect the password from the people trying to steal password. I did not know that but it is a nice gesture from mongo.

The output of ps indicates that you do not. You would need –keyFile argument to do it. And I want to restate

1 Like

Wow, you are absolutely right. I cannot believe I didn’t catch that. Re-ran the test and passed.

Thank you both for your insight!