Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14490

MongoDB Replica Set Questions

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.3
    • Replication
    • None

    Description

      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.

          [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
      }
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            sisir Sisir Chowdhury
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: