Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop: Unknown instance mongodb (Ubuntu)

I am new to Mongodb. When I run the following command:

sudo service mongodb start 

It shows me "mongodb start/running, process 3566". But when I try to stop by giving the below command:

sudo service mongodb stop 

It shows stop: Unknown instance:. Do anybody have any idea how to slove this issue.

And if I give sudo service mongodb restart, I'm getting the below message:

stop: Unknown instance:  mongodb start/running, process 3644 

PS: If I'm using just mongod, I could start the server and could connect the mongo shell by giving mongo.

Please suggest me how to fix the issue and how to connect mongo shell after giving service mongodb start. Thanks in advance.

like image 261
senthil Avatar asked Nov 09 '12 07:11

senthil


1 Answers

I just ran into this. Chances are the issue is in your conf file (obviously, since you reinstalled the seeded)

In the mongodb.conf do not set fork = true if calling it as a service. This will prevent the service call from being able to access it with service mongodb.conf status/stop/restart.

Removing a fork=True line, however, will alleviate the issue.

See comments; use the other solution even though this one is accepted.

like image 73
GoingTharn Avatar answered Oct 04 '22 15:10

GoingTharn