0

It is stated in the docs, that any replica set should have an odd number of members. Let's say I have a primary site with 3 members. I need to move one member to a backup site. In order to do this, do I need to first add a new member on the backup site, and them remove a member on the primary site? What is the official procedure? I'm very confused, because by the time the member is added, there will have been an even number of members. Where will I go from there? How dangerous it is to add a single member to a replica set without doing any hanky-panky?

Should I do some magic tricks (e.g. set priorites of particular members to zero) before I add a new member?

Is this documented somewhere?

1 Answer 1

1

Where you found that information that replica should have even number of members, because it is ODD number. With even number of members (votes) you could end up situation that you don't have majority. IF you have even number of data nodes, you need arbiter as fifth.

OK, to the question how to move one member. Let's assume that you have three nodes (primary + 2x secondary). If you want to be sure that your replica set stays up even you lost one member during that time that when one secondary is "on-the-move" and not up'n'running, bring one Arbiter to replica set. You can install arbiter to "any" other server, because it will not take resources (basically). You give command rs.addArb("address:port") just before you shutdown that secondary. After you start again that secondary at new location, you give command rs.remove("address:port"). That way you always have three votes online.

4
  • My fault, mixed up odd and even.
    – nagylzs
    Nov 9, 2017 at 20:25
  • Edited question, exchanged odd/even
    – nagylzs
    Nov 9, 2017 at 20:38
  • Shouldn’t it be rs instead of sh? ;) Nov 11, 2017 at 13:14
  • Yes, you are absolutely right.. ;-) It's replica set (rs) and not shard (sh). Need to edit my answer.. :-)
    – JJussi
    Nov 11, 2017 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.