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

  • Home
  • SEARCH
  • 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 7494103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:19:04+00:00 2026-05-29T17:19:04+00:00

I’ve been trying to setup a simple replication system. 1 main mongo, 1 backup,

  • 0

I’ve been trying to setup a simple replication system. 1 main mongo,
1 backup, and 1 arbiter.

Unfortunately, firing it up lead to main being elected SECONDARY, and
the backup being elected PRIMARY (nice work arbiter).

Main had a priority of 100, and backup a priority of 0, along with a
slave delay.

I tried to tell the backup to step down via:

PRIMARY>   db.runCommand({replSetReconfig: conf})
{
        "assertion" : "initiation and reconfiguration of a replica set must
be sent to a node that can become primary",
        "assertionCode" : 13420,
        "errmsg" : "db assertion failure",
        "ok" : 0
}
PRIMARY> .adminCommand({replSetStepDown:1000000, force:1})
Fri Jan 13 17:27:29 SyntaxError: syntax error (shell):1
PRIMARY> db.adminCommand({replSetStepDown:1000000, force:1})
Fri Jan 13 17:27:36 DBClientCursor::init call() failed
Fri Jan 13 17:27:36 query failed : admin.$cmd { replSetStepDown:
1000000.0, force: 1.0 } to: 127.0.0.1
Fri Jan 13 17:27:36 Error: error doing query: failed shell/
collection.js:151
Fri Jan 13 17:27:36 trying reconnect to 127.0.0.1
Fri Jan 13 17:27:36 reconnect 127.0.0.1 ok
SECONDARY>
SECONDARY>
SECONDARY> db.adminCommand({replSetStepDown:1000000, force:1})
{ "errmsg" : "not primary so can't step down", "ok" : 0 }

Which worked, but main is still seconday as well.

Any ideas? Thanks!

config file

conf = {
  version: 90002,
  _id : "example",
  members: [
    {
      _id : 1,
      host : "main.example.com:27017",
      priority: 100
    },
    {
      _id : 2,
      host : "backup.example.com:27017",
      priority: 0,
      slaveDelay : 3600
    },
    {
      _id : 3,
      host : "arbiter.example.com:27017",
      priority: 0,
      arbiterOnly: true
    }
  ]
};

rs.status on main()

{
  "set" : "example",
  "date" : ISODate("2012-01-13T23:29:09Z"),
  "myState" : 2,
  "members" : [
    {
      "_id" : 1,
      "name" : "main.example.com:27017",
      "health" : 1,
      "state" : 2,
      "stateStr" : "SECONDARY",
      "optime" : {
        "t" : 1326496827000,
        "i" : 1
      },
      "optimeDate" : ISODate("2012-01-13T23:20:27Z"),
      "self" : true
    },
    {
      "_id" : 2,
      "name" : "backup.example.com:27017",
      "health" : 1,
      "state" : 2,
      "stateStr" : "SECONDARY",
      "uptime" : 324,
      "optime" : {
        "t" : 1326492641000,
        "i" : 1
      },
      "optimeDate" : ISODate("2012-01-13T22:10:41Z"),
      "lastHeartbeat" : ISODate("2012-01-13T23:29:09Z"),
      "pingMs" : 0
    },
    {
      "_id" : 3,
      "name" : "arbiter.example.com:27017",
      "health" : 1,
      "state" : 7,
      "stateStr" : "ARBITER",
      "uptime" : 324,
      "optime" : {
        "t" : 0,
        "i" : 0
      },
      "optimeDate" : ISODate("1970-01-01T00:00:00Z"),
      "lastHeartbeat" : ISODate("2012-01-13T23:29:09Z"),
      "pingMs" : 0
    }
  ],
  "ok" : 1

}

rs.status() on backup

{
  "set" : "example",
  "date" : ISODate("2012-01-13T23:31:06Z"),
  "myState" : 2,
  "members" : [
    {
      "_id" : 0,
      "name" : "BACKUPVMW02:27017",
      "health" : 1,
      "state" : 2,
      "stateStr" : "SECONDARY",
      "optime" : {
        "t" : 1326492641000,
        "i" : 1
      },
      "optimeDate" : ISODate("2012-01-13T22:10:41Z"),
      "self" : true
    }
  ],
  "ok" : 1
  • 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-05-29T17:19:04+00:00Added an answer on May 29, 2026 at 5:19 pm

    you might be using an old version of mongodb–the field that they used for voting was called “votes” then, I think, not priority. When they switched over to the “priority” field, you should be calling rs.reconfig(configfile), I think.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post

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.