0

On my centos when I tried

mongdb

It starts.

But when I run it as service it wont start. What is the problem?

service mongodb start

http://screencloud.net/v/3weR

Rex Adrivan
  • 993
  • 1
  • 10
  • 23
  • 1
    Have you seen this? http://stackoverflow.com/questions/12232166/mongodb-on-ubuntu-wont-start-as-a-service-nothing-in-the-log – Mike S Apr 01 '15 at 05:14

3 Answers3

1

Firstly, run service mongod status

It should return mongod is stopped.

Now look in your mongo folder. There is probably a mongod.lock file in there. The only times I've seen this file created is when the power cord gets yanked out.

Remove the mongod.lock file:sudo rm mongod.lock

Start the service:sudo service mongod start

Peter O.
  • 32,158
  • 14
  • 82
  • 96
0

Take a look in the logs. Why do you think it dosen't started? Its a demon process, it runs in the background.

service mongod status

may help you.

Zarathustra
  • 2,853
  • 4
  • 33
  • 62
0

Just try this command.

sudo rm mongod.lock

And

sudo service mongod restart

may help you.

J.Jai
  • 597
  • 1
  • 5
  • 9