5

Sometimes I can get a connection, sometimes it fails

MongoDB shell version: 2.4.3
connecting to: test
Wed Jul  3 13:07:09.878 Socket recv() errno:104 Connection reset by peer 127.0.0.1:27017
Wed Jul  3 13:07:09.878 SocketException: remote: 127.0.0.1:27017 error: 9001 socket exception [1] server [127.0.0.1:27017]
Wed Jul  3 13:07:09.878 DBClientCursor::init call() failed
Wed Jul  3 13:07:09.880 JavaScript execution failed: Error: DBClientBase::findN: transport error: 127.0.0.1:27017 ns: admin.$cmd query: { whatsmyuri: 1 } at src/mongo/shell/mongo.js:L112
exception: connect failed
3
  • Try starting the mongo like this: mongo 127.0.0.1:27017. Commented Jul 3, 2013 at 5:22
  • @feng, provide mongodb log, please. Commented Jul 3, 2013 at 7:45
  • @amezhenin, fund something in log [initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable [initandlisten] can't create new thread, closing connection, seems to be caused by too many connections Commented Jul 3, 2013 at 9:06

1 Answer 1

7

I guess that in MongoDB logs you receive this:

Wed Jul 3 13:07:... connection refused because too many open connections: 819

Try to do following:

  • kill all mongodb processes
  • start mongod:

    $ mongod
    
  • start mongo like bellow:

    $ mongo 127.0.0.1:27017
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.