Fail Over Replica Set Mongodb

29 views
Skip to first unread message

Alexander Orwell Wolf

unread,
Apr 26, 2016, 7:54:43 PM4/26/16
to mongodb-user
Hello,

I have a replicaset with 3 nodes;

Server 1:
  • primary node

Server 2:

  • Secondary node
  • Arbiter node

when I stopped server 2 with secondary and arbiter, my primary in server 1 change to secondary.

What can I do to have primary node at server 1 if server 2 is offline?


Regards!

SHAILESH PURANI

unread,
Apr 27, 2016, 1:27:42 AM4/27/16
to mongodb-user
You can set the priority and accordingly it will works.

Regards,

Jeff Sherard

unread,
Apr 27, 2016, 6:25:00 PM4/27/16
to mongodb-user
Alexsander,

By necessity - Server 1/primary node will become a secondary if Server 2 goes down.  There is no longer a 'majority' available in the replica set (2/3).

You can force reconfigure the replica set to drop Server 2/secondary and Server 2/arbiter from the rs.config().  Essentially creating a 1 node replica set.


As per the documentation:
"Use this procedure only to recover from catastrophic interruptions."

The two server architecture you have is described is fine for a test environment.  But you would never want to run that way in a production environment.  Three servers would be a much better configuration.  You can make the server for the arbiter much much smaller since it is not a data bearing node.

Cheers,

Jeff Sherard
Reply all
Reply to author
Forward
0 new messages