MongoDB replica set exhibits repeated elections every 7–12 minutes after adding a low-power arbiter
Environment
Three-node MongoDB replica set: primary (m5.large, AWS us-east-1), secondary (m5.large), and a third node added as an arbiter on a low-power t3.small instance in a different AZ. MongoDB 4.4.10, WiredTiger, journaling enabled. Network between AZs over AWS VPC peering.
Symptoms
After adding the arbiter, the replica set performs a primary election roughly every 7–12 minutes. During elections, writes fail with 'not master' until a new primary is elected (typically the previous primary rejoins after a short interval). Application reports transient write errors and occasional increased latency during failover windows.
Observations
mongod logs show 'no healthy members in set', 'election triggered', and 'heartbeat failed' messages with timestamps clustered around election events. The arbiter logs show frequent short TCP disconnects to primaries around the same times; network monitoring shows packet retransmits between the arbiter and the primary on the arbiter's AZ network interface. When the arbiter is stopped, elections cease and the cluster is stable. Ping and traceroute between nodes show sub-10ms latency but intermittent packet loss (0.5–1%) observed from arbiter to other nodes using continuous ping over 24h.
Already attempted
Removed any firewall rules between nodes; restarted mongod on arbiter and primaries; increased replication heartbeatTimeoutMillis in replica set configuration from default to 10000 ms (no improvement); monitored CloudWatch network metrics (no significant CPU spikes on arbiter). Temporarily relocated arbiter to same AZ as primary and observed improved stability for one day before similar election churn returned. Replaced t3.small with t3.medium for higher baseline CPU — did not resolve elections.
Question
What targeted diagnostics and configuration changes can confirm whether the arbiter's intermittent connectivity is causing election churn or whether there is a replica set configuration/timing parameter that needs tuning? Is using an arbiter across AZs acceptable, and what are recommended practices for arbiter placement to avoid split-brain behaviours?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags