0

I searched on stack overflow couldn't find the solution for it.

I've 3 nodes 1 primary and 2 secondary nodes like, mongo1.com, mongo2.com and mongo3.com.

Everything is working well with the connection. When I shutdown anyone node, e.g. mongo1.com, my app is working fine. Again I shutdown 2nd node e.g. mongo3.com then app stopped working. In case I enable anyone node enable then app again working fine.

In short, with single node app not working. Looking for guideline / answer for the behaviour.

I checked status using rs.status(), two node show me health: 0 and message: unreachable node. Third node which is active show health: 1 and "infoMessage" : "could not find member to sync from"

Gunjan Patel
  • 2,342
  • 4
  • 24
  • 45
  • Does this answer your question? [MONGO election primary](https://stackoverflow.com/questions/63050967/mongo-election-primary) – D. SM Oct 01 '20 at 17:03
  • This is expected behavior, see https://stackoverflow.com/questions/63050967/mongo-election-primary/63053826#63053826. – D. SM Oct 01 '20 at 17:04
  • @D.SM You mean to say we need to add more nodes or we need make all primary as primary node to work around? – Gunjan Patel Oct 02 '20 at 14:26
  • What problem are you trying to solve? – D. SM Oct 02 '20 at 16:43
  • @D.SM when 2 node shutdown out of 3, single node we need made manually primary, can't we configure it? Because when 2 node shutdown application not working. – Gunjan Patel Oct 05 '20 at 07:23
  • 1
    To have a primary in a 3 node replica set at least 2 nodes must be operational. – D. SM Oct 05 '20 at 10:40
  • Okay Understood.! There is no way to solve these problem. unexpectedly two node shutdown. – Gunjan Patel Oct 05 '20 at 12:01

1 Answers1

0

I did multiple research and found that if 2 node shutdown then you can manually made running node as primary.

To have a primary in a 3 node replica set at least 2 nodes must be operational.

Gunjan Patel
  • 2,342
  • 4
  • 24
  • 45