Error: no primary server found in set

220 views
Skip to first unread message

rakatti

unread,
Mar 7, 2013, 12:06:46 AM3/7/13
to mongod...@googlegroups.com

We have a three node cluster...one primary and one secondary. Following error gets randomly thrown

when we have several writes per second

Error: no primary server found in set

 We are using newer drivers

"mongodb": "1.2.13"

"mongoskin": "0.5.0"


We pass the following parameter to the driver.

{

"mongo_repl_set_hosts": ["hostname1:27017/?auto_reconnect=true", "hostname2:27017/?auto_reconnect=true","hostname3:27017/?auto_reconnect=true"],

"mongo_repl_set_options": {"read": "secondary", "auto_reconnect":true, safe: true}
}

}

Aaron Heckmann

unread,
Mar 7, 2013, 4:17:38 PM3/7/13
to mongod...@googlegroups.com
Hi there, could you post the method you are using to connect to mongodb? This will help determine the cause of the error message.

rakatti

unread,
Mar 8, 2013, 4:16:00 AM3/8/13
to mongod...@googlegroups.com

Yes it was happening due to too many open connections and was hitting limit of 819...
we have fixed the problem by having one connection per server instance...

Aaron Heckmann

unread,
Mar 8, 2013, 12:35:51 PM3/8/13
to mongod...@googlegroups.com
Yes, best practice in node is to open the connection when the application starts and reuse it. When the app shuts down you should close the db.


--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Aaron


Reply all
Reply to author
Forward
0 new messages