I have a simple replica set configured as follows:
- mongo1 (primary)
- mongo2 (secondary)
- mongo3 (arbiter)
It functioned correctly for around a month and then we started seeing intermittent exceptions along the lines of:
Moped::Errors::ReplicaSetReconfigured: The operation: #<Moped::Protocol::Command
@length=179 @request_id=1400 @response...>{:order=>"SwimSet"}, :update=>{"$inc"=>
{:next=>1}}, :new=>true, :upsert=>true} @fields=nil> failed with error "not master"
They key bit being "failed with error not master. This happens sporadically when trying to write to a collection. This is not during or immediately after a failover. Shutting the secondary down but leaving the arbiter running resolves the error but leaves us without any redundancy.
What we've tried:
- Rebuilding the secondary and re-adding it to the cluster
- Failing over to the newly built node, then rebuilding the old primary
- Upgrading to Mongo 2.6.4
Current Versions:
- Mongo Server: 2.6.4
- Mongoid: 3.1.6
- Moped: 1.5.2
Any suggestions very much appreciated as been battling with this on and off for nearly a month now.