SocketException in Mongo

I just installed a replica set in Mongo (prod environment). Now I get a lot of exceptions, like below (trimmed).

I went to mongo and ran the serverStatus command on my main mongo node and only about 300 connections, so it hardly works.

The following are the options for connecting to my server code:

auto_connect_retry = false connections_per_host = 10 threads_multiplier = 10 max_wait_time = 120000 connect_timeout = 10000 socket_timeout = 0 

Do I have something incorrectly configured?

 Sep 9, 2013 8:31:26 PM com.mongodb.DBPortPool gotError WARNING: emptying DBPortPool to /10.0.8.10:27017 b/c of error java.net.SocketException: Connection timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:146) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.bson.io.Bits.readFully(Bits.java:46) at org.bson.io.Bits.readFully(Bits.java:33) at org.bson.io.Bits.readFully(Bits.java:28) at com.mongodb.Response.<init>(Response.java:40) at com.mongodb.DBPort.go(DBPort.java:142) at com.mongodb.DBPort.call(DBPort.java:92) at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273) at com.mongodb.DBCollection.findOne(DBCollection.java:347) at com.mongodb.DBCollection.findOne(DBCollection.java:332) at com.mongodb.casbah.MongoCollectionBase$class.findOneByID(MongoCollection.scala:232) at com.mongodb.casbah.MongoCollection.findOneByID(MongoCollection.scala:866) at com.novus.salat.dao.SalatDAO.findOneById(SalatDAO.scala:353) at com.novus.salat.dao.ModelCompanion$class.findOneById(ModelCompanion.scala:173) 
+8
scala mongodb casbah
source share
1 answer

Typically, a connection timeout occurs from one of the following in a replica set
1) All participants cannot communicate with each other
2) The program connects to the replica for updating and cannot send it to the primary one due to overload or 1st, as well as
3) All relics are not synchronized, and one is too far behind

4) the election of the leader is ongoing but not completed for some reason

Verify that your replica set matches and all nodes work by uploading rs.status () to the primary node, as well as the previously proposed primary log checks for more information

0
source share

All Articles