Chapter 2 Lab Deploy a Replica Set

Hi,
The requirement of this lab was to deploy a replica set.
This is the output of my rs.isMaster() :
indent preformatted text by 4 spaces m103-repl:PRIMARY> rs.isMaster()
{
“hosts” : [
“localhost:27001”,
“localhost:27002”,
“localhost:27003”
],
“setName” : “m103-repl”,
“setVersion” : 3,
“ismaster” : true,
“secondary” : false,
“primary” : “localhost:27001”,
“me” : “localhost:27001”,
“electionId” : ObjectId(“7fffffff0000000000000001”),
“lastWrite” : {
“opTime” : {
“ts” : Timestamp(1589080850, 1),
“t” : NumberLong(1)
},
“lastWriteDate” : ISODate(“2020-05-10T03:20:50Z”),
“majorityOpTime” : {
“ts” : Timestamp(1589080850, 1),
“t” : NumberLong(1)
},
“majorityWriteDate” : ISODate(“2020-05-10T03:20:50Z”)
},
“maxBsonObjectSize” : 16777216,
“maxMessageSizeBytes” : 48000000,
“maxWriteBatchSize” : 100000,
“localTime” : ISODate(“2020-05-10T03:20:55.655Z”),
“logicalSessionTimeoutMinutes” : 30,
“minWireVersion” : 0,
“maxWireVersion” : 7,
“readOnly” : false,
“ok” : 1,
“operationTime” : Timestamp(1589080850, 1),
“$clusterTime” : {
“clusterTime” : Timestamp(1589080850, 1),
“signature” : {
“hash” : BinData(0,“rb4j3GQHPAkPC6oiCMqP6a14twQ=”),
“keyId” : NumberLong(“6825045084539453441”)
}
}
}

When i hit Test Run it shows me out of 12 test cases I passed only 10 and those which are not passed are this:

`12 total, 10 passed, 0 skipped:

[PASS] “localhost:27001 is running”
[PASS] “localhost:27002 is running”
[PASS] “localhost:27002 is running”
[PASS] “Replication is enabled on localhost:27001”
[PASS] “Replication is enabled on localhost:27002”
[PASS] “Replication is enabled on localhost:27003”
[PASS] “The replica set ‘m103-repl’ contains localhost:27001”
[FAIL] “The replica set ‘m103-repl’ contains localhost:27002”
(in test file /tmp/eval.sh, line 109)
`[[ ! $localhost_27002_member != “notjoined” ]]’ failed

  • have you added ‘localhost:27002’ to the replica set ‘m103-repl’?
    [FAIL] “The replica set ‘m103-repl’ contains localhost:27003”
    (in test file /tmp/eval.sh, line 121)
    `[[ ! $localhost_27003_member != “notjoined” ]]’ failed

  • have you added ‘localhost:27003’ to the replica set ‘m103-repl’?
    [PASS] “The replica set enforces client authentication”
    [PASS] “The user m103-admin was created with the right password”
    [PASS] “The replica set m103-repl uses keyfile authentication”`

Kindly help how do i clear this lab. I have tried all the possible ways.
Also I checked the forum, few said there is error in validation script. How do I overcome this?
Thank you.

1 Like

Please check this link

[Issue with the test suite] Lab: Deploy a Replica Set

Thank you @Ramachandra_37567

Hi @Rahulkumar_Das,

As @Ramachandra_37567 mentioned, there is an issue in this lab. We are currently working on fixing the issue in this lab. It will be fixed within 24 hours. Thanks for your patience.

~ Shubham

1 Like

Hi @Rahulkumar_Das,

The issue has been resolved. You can complete this lab now. Please let me know if you still face any issue.

~ Shubham

Hi I’m having a different issue. After I deploy the replica set and click on run test it does not grade my lab. I do not get an incorrect or a passing on it. Any assistance will be greatly appreciated thanks

Hi @Richard_88382,

Can you please share a screenshot of what you see on the screen ?

~ Shubham

It stays like that indefinitely

Most likely reason is that you misnamed the replica set.

Spot on @steevej-1495 I had a typo in my replicas set name. Thanks

Hi

I am getting the same issue when I run the test but This is the output of my rs.isMaster() :
indent preformatted text by 4 spaces m103-repl:PRIMARY> rs.isMaster()
{
“hosts” : [
“localhost:27001”
],
“setName” : “m103-repl”,
“setVersion” : 1,
“ismaster” : true,
“secondary” : false,
“primary” : “localhost:27001”,
“me” : “localhost:27001”,
“electionId” : ObjectId(“7fffffff0000000000000001”),
“lastWrite” : {
“opTime” : {
“ts” : Timestamp(1622575155, 1),
“t” : NumberLong(1)
},
“lastWriteDate” : ISODate(“2021-06-01T19:19:15Z”),
“majorityOpTime” : {
“ts” : Timestamp(1622575155, 1),
“t” : NumberLong(1)
},
“majorityWriteDate” : ISODate(“2021-06-01T19:19:15Z”)
},
“maxBsonObjectSize” : 16777216,
“maxMessageSizeBytes” : 48000000,
“maxWriteBatchSize” : 100000,
“localTime” : ISODate(“2021-06-01T19:19:22.660Z”),
“logicalSessionTimeoutMinutes” : 30,
“minWireVersion” : 0,
“maxWireVersion” : 7,
“readOnly” : false,
“ok” : 1,
“operationTime” : Timestamp(1622575155, 1),
“$clusterTime” : {
“clusterTime” : Timestamp(1622575155, 1),
“signature” : {
“hash” : BinData(0,“U3ZrVIKn4q951CWC24bXXRifClA=”),
“keyId” : NumberLong(“6968897991847444481”)
}
}
}

But I have tried adding the two nodes to the replica set using rs.add().

I dnt understant wht is the issue can you please help.

@steevej @Shubham_Ranjan @Ramachandra_Tummala @Santiago_Miranda

Hi, can someone please help me with this I m stuck?

m103-repl:PRIMARY> rs.add(“m103:27003”)
{
“operationTime” : Timestamp(1622577178, 1),
“ok” : 0,
“errmsg” : “Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2”,
“code” : 103,
“codeName” : “NewReplicaSetConfigurationIncompatible”,
“$clusterTime” : {
“clusterTime” : Timestamp(1622577178, 1),
“signature” : {
“hash” : BinData(0,“C5NalcNClLOq/pscq3JLZUJtYsw=”),
“keyId” : NumberLong(“6968911877476712449”)
}
}
}
m103-repl:PRIMARY>

This is what I get when I try to add other nodes.

Hey Guys,

I got it. I m adding nodes incorrectly it should be rs.add(“localhost:27003”)

Thanks.

Hi @yugandhar_boddati,

We are glad that you were able to resolve your issue.
For more information take a look here.

Regards,
Kushagra