Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:36:43+00:00 2026-06-13T11:36:43+00:00

I am trying to configure a replica set with two nodes but when I

  • 0

I am trying to configure a replica set with two nodes but when I execute rs.add("node2") and then rs.status() both nodes are set to PRIMARY. Also when I run rs.status() on the other node the only node that appears is the local one.

Edit1:
rs.status() output:

    {
        "set" : "rs0",
        "date" : ISODate("2012-09-22T01:01:12Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "node1:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 70968,
                        "optime" : Timestamp(1348207012000, 1),
                        "optimeDate" : ISODate("2012-09-21T05:56:52Z"),
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "node2:27017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "uptime" : 68660,
                        "optime" : Timestamp(1348205568000, 1),
                        "optimeDate" : ISODate("2012-09-21T05:32:48Z"),
                        "lastHeartbeat" : ISODate("2012-09-22T01:01:11Z"),
                        "pingMs" : 0
                }
        ],
        "ok" : 1
}

Edit2: I tried doing the same thing with 3 different nodes and I got the same result (rs.status() says I have a replica set with three primary nodes). Is it possible that this problem is caused by some specific configuration of the network?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:36:44+00:00Added an answer on June 13, 2026 at 11:36 am

    If you issue rs.initiate() from both of your the members of the replica set before rs.add() then both will come up as primary.

    You should only use rs.initiate() on one of the members of the replica set, the one that you intend to be primary initially. Then you can rs.add() the other member to the replica set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to configure a one to one relationship between entities which both have
I'm trying to configure EhCache with JGroups-based replication, but I get log flooded with
I'm trying to configure the HighStock Stockchart to use a two dimensional array of
I've been trying to configure two separate Django apps on one server such that
I'm trying to configure a form for Zend_Form using Zend_Config_Ini, and wish to set
I am trying to configure Apache on my Linux system, but it does not
I am trying to configure dhclient. The specification says that I should add vendor-specific
I am simulating MongoDB replica set step-downs and trying to have my application and
Am trying to configure a two component picker, and am getting some errors which
I'm trying to configure EGit on my portable Eclipse app. I needed then to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.