5

i am using mongo 3.0.2 version suddenly, i have got a problem in mongodb. Till yesterday mongodb is running fine. but today when i start mongo then it gives the following error.

2015-04-29T10:57:47.732+0530 W NETWORK  Failed to connect to  127.0.0.1:27017, reason: errno:111 Connection refused
2015-04-29T10:57:47.733+0530 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed

i have checked on internet. deleted the mongo lock file. but didn't resolve the problem yet.

when i check the service is show waiting and after start it doen't start as

 service mongod status
 mongod stop/waiting
 sudo service mongod start
 mongod start/running, process 2520
 service mongod status
 mongod stop/waiting

and anyone help to solve it out and explain why this problem occur.

Sourbh Gupta
  • 808
  • 7
  • 16

7 Answers7

7

I had the same issue and I managed to start mongod following those steps

1) mkdir data

2) cd data

3) mongod -dbpath .

svassr
  • 5,538
  • 5
  • 44
  • 63
2

Use this command, it works fine:

sudo mongod --config /etc/mongod.conf --fork
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
1

Try using sudo mongo to connect

1

Please make sure if port 27017 is already opened and didn't used by any application. You can check it with netstat command

0

Can you check whether port already used or not? Below attaching link of similar issue: Connection refused to MongoDB errno 111

Still problem persist then let me know.

Community
  • 1
  • 1
0

check in the log file /var/log/mongodb/mongodb.log. I also got the same issue but due to lack of disk space.

exception in initAndListen: 15926 Insufficient free space for journals, terminating
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
lalit
  • 41
  • 4
0

Delete mongod.lock file in

data/db/mongod.lock

Then Run Again It Works Fine :)

Gopinath Kaliappan
  • 6,929
  • 8
  • 37
  • 60