[SERVER-14490] MongoDB Replica Set Questions Created: 07/Jul/14  Updated: 10/Dec/14  Resolved: 07/Jul/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.6.3
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Sisir Chowdhury Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File mongodb_case    
Participants:

 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
}
 



 Comments   
Comment by Thomas Rueckstiess [ 07/Jul/14 ]

Hi Sisir,

This is an unusual setup. Our recommendation is one mongod per host. We also recommend an odd number of nodes per replica set, see our documentation on how to Deploy a Replica Set. You might also want to use a port number in the higher range above 1024, the default mongodb port is 27017.

Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server.

For MongoDB-related support discussion please post on the mongodb-users group (http://groups.google.com/group/mongodb-user) or Stack Overflow with the mongodb tag.

Regards,
Thomas

Generated at Thu Feb 08 03:35:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.