Cannot Remote Access Mongodb 3.4.4

474 views
Skip to first unread message

Need Help

unread,
Jul 13, 2017, 2:43:47 PM7/13/17
to mongodb-user
We have used mongodb 3.0.12 for a long time, and I am used to remote log into mongodb either from eclipse java or command line, by using "mongo --host xxx".  However, ever since we upgraded to mongodb 3.4.4, I can do neither, although I can still access local host, and I can still remotely log into other servers with mongodb 3.0.12.  Has something changed in 3.4.4?  I would love to have the old way back, because it would make my life much easier. 

Thanks for your help in advance. 

Need Help

unread,
Jul 13, 2017, 2:48:19 PM7/13/17
to mongodb-user
This is the stack trace:

Jul 13, 2017 11:37:31 AM com.mongodb.diagnostics.logging.JULLogger log
INFO: Cluster created with settings {hosts=[canton.itw:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
Jul 13, 2017 11:37:32 AM com.mongodb.diagnostics.logging.JULLogger log
INFO: Exception in monitor thread while connecting to server xxx:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
    at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
    at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
    at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:57)
    at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
    ... 3 more

Jul 13, 2017 11:37:32 AM com.mongodb.diagnostics.logging.JULLogger log
INFO: No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=xxx:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]}. Waiting for 30000 ms before timing out

Kevin Adistambha

unread,
Aug 2, 2017, 12:57:40 AM8/2/17
to mongodb-user

Hi,

Has something changed in 3.4.4?

Not that I’m aware of. There is a 3.4 changelog page that describes every important change that was included in each release of the 3.4 series.

Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]}. Waiting for 30000 ms before timing out

This error means that the Java driver tried to connect to a closed port. For example, I see an identical series of message if I’m trying to connect to a non-existent server. Could you please double check the server address, see if you’re connecting to the correct IP/port, and confirm that there is no firewall blocking communication between the client and the server?

If you’re still having trouble with this, could you post:

  • Your MongoDB version and your OS version
  • Relevant error messages in the mongod logs
  • Java connection code that outputs this error message
  • What have you tried so far (i.e. connecting with the mongo shell, other drivers, etc.)

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages