I have installed mongodb in my Ubuntu 10.04.
I know that when it comes to start the mongodb server with the command \"mongod\",then it expects /data/db
Assuming you have followed the instructions to install a packaged version of MongoDB, you should be starting and stopping mongod
using service
.
To start mongod
:
sudo service mongodb start
To stop mongod
:
sudo service mongodb stop
If you use the service command to start and stop, it should be using the configuration file: /etc/mongodb.conf
.
mongod
from the command lineIf you run mongod
directly instead of using the service definition, you will also have to specify a configuration file as a command line parameter if you want one to be used:
mongod --config /etc/mongodb.conf