SocketException en Mongo

I just set up a replica set in Mongo (prod environment). I'm now getting a lot of exceptions like below (clipped).

I went into mongo and ran a serverStatus command on my primary mongo node and only have about 300 connections going, so it's hardly working.

Below are my connection option settings in 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 mis-configured?

Sep 9, 2013 8:31:26 PM com.mongodb.DBPortPool gotError
WARNING: emptying DBPortPool to / b/c of error Connection timed out
    at Method)
    at com.mongodb.Response.<init>(
    at com.mongodb.DBPort.go(
    at com.mongodb.DBTCPConnector.innerCall(
    at com.mongodb.DBApiLayer$MyCollection.__find(
    at com.mongodb.DBApiLayer$MyCollection.__find(
    at com.mongodb.DBCollection.findOne(
    at com.mongodb.DBCollection.findOne(
    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)

preguntado el 10 de septiembre de 13 a las 00:09

Could you attach the logs for the primary node? -

Also, please tell us how you connect the replica set by showing the relevant code or configuration. -

1 Respuestas

Generally a connection timeout occurs from one of the following in a replica set
1) All members are not able to communicate with each other
2) A program is connecting to replica for update and it is unable to send it to primary due to overload or 1st as well
3) All relicas are not in sync and one is lagging behind too much
4) Leader election is going on but not completed due to some reason

Please check if your relica set is consistent and all nodes are working by issuing rs.status() on primary node , also as earlier suggested check primary logs for more information

Respondido 27 Oct 15, 11:10

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.