Mongodb – Mongodump on Replica Set

mongodb

Running backups on a Mongo Replica set – 1 primary, 1 secondary, 1 arbitrar. Had a instance where all three stopped talking to one another and all went to secondary.

I ran a backup against the the Replica set with Mongodump. Would that cause the DB's to switch? Is there harm in running mongodump against a running production system on the Primary?

Best Answer

Its not a good idea to run the backup against the Primary. The extra load you adding on the Primary might cause heartbeat failures and trigger an election. Now in your case, overloading the primary might caused an election, you can see that info on your logs, but the other secondary didn't become new primary which expected to. I see some cases why didn't. 1) Replication lag was big 2) you run the replica set on the same server or storage so all nodes get affected but here logs are your best friend on what really happened.