Replication not working

[Lecture: Setting Up a Replica Set]

I’ve completed up to the below.

Check sharding status:
MongoDB Enterprise mongos> sh.status()

And then, I’ve modified node1.conf , node2.conf and node3.conf as provided.

But replicat set is not working after then. It also looks like Replica set name has not been changed to ‘m103-repl’. It still is m103-example.

belowa are node1.

MongoDB Enterprise m103-example:OTHER> rs.status()
{
“state” : 10,
“stateStr” : “REMOVED”,
“uptime” : 283,
“optime” : {
“ts” : Timestamp(1582569553, 1),
“t” : NumberLong(23)
},
“optimeDate” : ISODate(“2020-02-24T18:39:13Z”),
“lastHeartbeatMessage” : “”,
“syncingTo” : “”,
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“ok” : 0,
“errmsg” : “Our replica set config is invalid or we are not a member of it”,
“code” : 93,
“codeName” : “InvalidReplicaSetConfig”,
“operationTime” : Timestamp(1582569553, 1),
“$gleStats” : {
“lastOpTime” : Timestamp(0, 0),
“electionId” : ObjectId(“000000000000000000000000”)
},
“$configServerState” : {
“opTime” : {
“ts” : Timestamp(1582569925, 1),
“t” : NumberLong(1)
}
},
“$clusterTime” : {
“clusterTime” : Timestamp(1582569925, 1),
“signature” : {
“hash” : BinData(0,“vPHSTExKbkwHKNsEL40bH5KgnIk=”),
“keyId” : NumberLong(“6797082996311588891”)
}
}
}
MongoDB Enterprise m103-example:OTHER>

Here is node2.

vagrant@m103:~$ mongo --port 27012 -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
MongoDB shell version v3.6.17
connecting to: mongodb://127.0.0.1:27012/?authSource=admin&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“e79db221-8b42-4dd8-99d6-accf06d05214”) }
MongoDB server version: 3.6.17
Server has startup warnings:
2020-02-24T18:38:33.824+0000 I STORAGE [initandlisten]
2020-02-24T18:38:33.824+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-02-24T18:38:33.824+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten]
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten]
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2020-02-24T18:38:34.502+0000 I CONTROL [initandlisten]
MongoDB Enterprise m103-example:OTHER>
MongoDB Enterprise m103-example:OTHER> rs.status()
{
“state” : 10,
“stateStr” : “REMOVED”,
“uptime” : 905,
“optime” : {
“ts” : Timestamp(1582569483, 1),
“t” : NumberLong(23)
},
“optimeDate” : ISODate(“2020-02-24T18:38:03Z”),
“lastHeartbeatMessage” : “”,
“syncingTo” : “”,
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“ok” : 0,
“errmsg” : “Our replica set config is invalid or we are not a member of it”,
“code” : 93,
“codeName” : “InvalidReplicaSetConfig”,
“operationTime” : Timestamp(1582569483, 1),
“$gleStats” : {
“lastOpTime” : Timestamp(0, 0),
“electionId” : ObjectId(“000000000000000000000000”)
},
“$configServerState” : {
“opTime” : {
“ts” : Timestamp(1582570414, 1),
“t” : NumberLong(1)
}
},
“$clusterTime” : {
“clusterTime” : Timestamp(1582570414, 1),
“signature” : {
“hash” : BinData(0,“YK5rU/QwLzkPYBVE34bDkWmT0Xs=”),
“keyId” : NumberLong(“6797082996311588891”)
}
}
}
MongoDB Enterprise m103-example:OTHER>

and here is node3.

MongoDB Enterprise m103-example:OTHER> rs.status()
{
“state” : 10,
“stateStr” : “REMOVED”,
“uptime” : 917,
“optime” : {
“ts” : Timestamp(1582569543, 1),
“t” : NumberLong(23)
},
“optimeDate” : ISODate(“2020-02-24T18:39:03Z”),
“lastHeartbeatMessage” : “”,
“syncingTo” : “”,
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“ok” : 0,
“errmsg” : “Our replica set config is invalid or we are not a member of it”,
“code” : 93,
“codeName” : “InvalidReplicaSetConfig”,
“operationTime” : Timestamp(1582569543, 1),
“$gleStats” : {
“lastOpTime” : Timestamp(0, 0),
“electionId” : ObjectId(“000000000000000000000000”)
},
“$configServerState” : {
“opTime” : {
“ts” : Timestamp(1582570454, 1),
“t” : NumberLong(1)
}
},
“$clusterTime” : {
“clusterTime” : Timestamp(1582570454, 1),
“signature” : {
“hash” : BinData(0,“i8k3mDsNEZx3eKCJmZXo8hanetk=”),
“keyId” : NumberLong(“6797082996311588891”)
}
}
}
MongoDB Enterprise m103-example:OTHER>

What modifications did you do? Also state what lab title is.

And show the rs.config()

1 Like

Hi @BEOM_77926,

Please provide the information requested by @007_jb.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

I’ve removed all folder from node1 ~3.conf and recreated.
And then it works now. The previous replica set name was m103-example.
I’m not sure, but I think it cached somewhere,

Thank you for the help.
Brian

Hi @BEOM_77926,

Yes, the entire topology of the replica set gets shared with each node.

I’m glad your issue got resolved. Please feel free to get back to us if you have any other query.

Thanks,
Shubham Ranjan
Curriculum Services Engineer