Hi,
I am new to MongoDB. Will really appreciate if someone can help me here :
I have a 3 member replica set with one primary and two secondaries. Everything was working fine, but today suddenly I noticed that the primary has become secondary and one of the secondaries has become primary. When I run rs.status() on this instance, it shows the status and in "last heartbeat received" field I see the message "couldn't find an instance to sync from". I am not sure if the primary was down for sometime and automatic failover took place.
This is driving me crazy? What could be the reason? Any help will be highly appreciated.
Thanks!
Hi, an arbiter is a replica set member that doesn't store data and hence can never become a primary. So the main reason to have an arbiter is to economise on space, which reduces redundancy. I can see a hosting company doing this, and offering a 3-member replica where in fact only 2 members store data - but is this what you want ? Personally, I'd have all 3 members storing data.
Justin Njoh
MVPs & POCs on NoSQL DBs - why not ?
Hi Robert, That any member of a replica set (that is not configured as an arbiter) can become a primary is quite normal and there is nothing to worry about. If the current primary became unreachable for whatever reason (network issues, downtime, etc) a 'voting' process takes place to determine which of the secondaries becomes the primary. And when the previous primary became available, it would become a secondary.
This is all done transparently to the application ... and the driver should always connect to the current primary.