1

I'm trying to set to 0 the number of votes of a replica set member via a mongo shell connected to the primary, but i get an error when i call:

rstest:PRIMARY> rs.reconfig(conf)
{
  "ok" : 0,
  "errmsg" : "priority must be 0 when non-voting (votes:0)",
  "code" : 103
}

What i do is:

rstest:PRIMARY> conf = rs.conf()
   ...     //the conf document
rstest:PRIMARY> conf.members[0].votes = 0 
rstest:PRIMARY> rs.reconfig(conf)

Where conf.members[0] is the SECONDARY's doc conf

At this link the MongoDB's documentation says:

...

cfg = rs.conf()
cfg.members[3].votes = 0
cfg.members[4].votes = 0
cfg.members[5].votes = 0
rs.reconfig(cfg)

This sequence gives 0 votes to the fourth, fifth, and sixth members of the set according to the order of the members array in the output of rs.conf(). This setting allows the set to elect these members as primary but does not allow them to vote in elections.

...

But the error message returned says that i have to set priority=0 for non-voting, but this implicate that member cannot be a primary.

What I did not understand or where am I doing wrong?

Thanks a lot

Community
  • 1
  • 1
lallacat
  • 11
  • 2
  • 1
    Welcome to SO. your question may fit better in [dba.stackexchange.com](http://dba.stackexchange.com/) but make sure to visit their [Help Center](http://dba.stackexchange.com/help) page so you know what the site there is about – styvane Nov 14 '16 at 18:23
  • can you post your config file or alteast the config section for member 4 and 5 – satish chennupati Nov 14 '16 at 18:43

1 Answers1

0

Your problem is that current MongoDB versions don't allow 0 votes on nodes what's priority > 0. With "old" MongoDB versions you could do that.. If I remember correct, 2.6 was last version where you could do that...

JJussi
  • 1,540
  • 12
  • 12