-
Type:
Question
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.6.3
-
Component/s: Replication
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Here is what I am trying to do:
-
- I have 2 MongoDB nodes - want them to participate in 2 replicaSets.
and have each node node become Primary for each cluster.
- I have 2 MongoDB nodes - want them to participate in 2 replicaSets.
[Node-1] <............RS1...........> [Node-2]
<............RS2...........>
I want Node-1 as PRIMARY for RS1 and Node-2 for RS2.
I am doing rs.initiate()/ rs.add() etc on Node-1 Only.
Node-1 is in FATAL State.
Node-2 does NOT have Node-1's Info.
Anything I am missing ?
How I am Starting MongoDB at Node-1?
=================================
sudo ./bin/mongod --replSet "rs1" --nojournal --port 101 --dbpath /data/db1 sudo ./bin/mongod --replSet "rs2" --nojournal --port 102 --dbpath /data/db2
I see the following output on Node-1
===============================
rs1:FATAL> rs.status()
{
"set" : "rs1",
"date" : ISODate("2014-07-07T22:28:25Z"),
"myState" : 4,
"members" : [
{
"_id" : 0,
"name" : "Mongo-1:101",
"health" : 1,
"state" : 4,
"stateStr" : "FATAL",
"uptime" : 1776,
"optime" : Timestamp(1404763473, 1),
"optimeDate" : ISODate("2014-07-07T20:04:33Z"),
"self" : true
},
{
"_id" : 1,
"name" : "Mongo-2:101",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 1776,
"optime" : Timestamp(1404763457, 1),
"optimeDate" : ISODate("2014-07-07T20:04:17Z"),
"lastHeartbeat" : ISODate("2014-07-07T22:28:24Z"),
"lastHeartbeatRecv" : ISODate("1970-01-01T00:00:00Z"),
"pingMs" : 0,
"electionTime" : Timestamp(1404764778, 1),
"electionDate" : ISODate("2014-07-07T20:26:18Z")
}
],
"ok" : 1
}
I see the following output on Node-2
===============================
{
"set" : "rs2",
"date" : ISODate("2014-07-07T22:29:02Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "Mongo-2:102",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 6538,
"optime" : Timestamp(1404765616, 1),
"optimeDate" : ISODate("2014-07-07T20:40:16Z"),
"electionTime" : Timestamp(1404765616, 2),
"electionDate" : ISODate("2014-07-07T20:40:16Z"),
"self" : true
}
],
"ok" : 1
}