1

when I try to start my database, mongodb is logging the following messages:

2014-08-12T08:42:17.522-0300 [initandlisten] journal dir=/www/mongodb/data/journal
2014-08-12T08:42:17.523-0300 [initandlisten] recover : no journal files present, no    recovery needed
2014-08-12T08:42:17.564-0300 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2014-08-12T08:42:17.564-0300 [initandlisten] ERROR:   addr already in use
2014-08-12T08:42:17.567-0300 [initandlisten] now exiting
2014-08-12T08:42:17.567-0300 [initandlisten] dbexit:
2014-08-12T08:42:17.567-0300 [initandlisten] shutdown: going to close listening sockets...

And it wont start. But then I run the next command nothing is returned:

sudo netstat -ltnp | grep 27017

The server was manually shutdown (db.shutdownServer()) and it is a part of a replica set.
I noticed that the mongod.lock is created in the process, but removing it doesnt solve the problem.

So i guess the error message isnt quite right.
I'm using MongoDB shell version: 2.6.1

Anyone knows what could be the problem?

Community
  • 1
  • 1
andrade
  • 143
  • 1
  • 1
  • 6
  • May be you should have a look at a [similar question](http://stackoverflow.com/questions/6478113/unable-to-start-mongodb-local-server?rq=1) – Robert Christopher Aug 12 '14 at 15:28
  • Thanks for the reply, but I've looked that one already. Everyone was talking about another process running, wich i've already checked. – andrade Aug 13 '14 at 14:30
  • Have the same problem and nothing helps.. Where should I can kill another socket? Even restart of hole machine gives nothing... – Serhio g. Lazin Jan 06 '15 at 17:30

1 Answers1

2

I had same issue. In my config file in bindIp I had 2 ports specified, and for some reason mongo tried to run both of them simultaneously. Leave only one and make sure it is in etc/hosts.