Reputation: 1
Im new to Mongodb and cuyrrently im working on replication and failover (3 nodes) in mongodb with rails application. After creating Rails app in the gem file i have added mongoid version 3.0.16 and created mongoid.yml file. In this i have configured the replica set for our rails app. All are working fine, when the primary goes down one of the secondary promotes to primary.
This is working fine but the problem is the rails app is not communicating with the newly promoted primary. When trying on the writing process it gives " connection unable to find the primary", and also the reading process does not take place " Unable to find the secondary or primary error".
How to resolve this?
Upvotes: 0
Views: 128
Reputation: 1
I resolved it by myself, in secondaries we have to give the command rs.slaveOk(), then only it can resolve the read options. After giving this command the Failover is also working fine.
Upvotes: 0