today I updated my Mongo.. mongodb-stable (from 10gen repo)
but my service has down. the following command not working
$ sudo service mongodb start
Running Ubuntu 11.10 confirm you have the latest version of MongoDB:
$ mongod --version
db version v2.2.0
(If you don't have the latest version of MongoDB, follow the Ubuntu Installation instructions at: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)
First confirm that the mongodb user/group has permission to write to the data directory:
$ sudo chown -R mongodb:mongodb /var/lib/mongodb/.
Start up MongoDB as a Daemon (background process) using the following command:
$ mongod --fork --dbpath /var/lib/mongodb/ --smallfiles --logpath /var/log/mongodb.log --logappend
To Shut Down MongoDB enter the Mongo CLI, access the admin and issue the shutdown command:
$ ./mongo
> use admin
> db.shutdownServer()
See: http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
you should have mentioned which LINUX distribution and version you are using..
works fine for me on Fedora 13 and 14:
# service mongod status
mongod (pid 6403) is running...
# service mongod stop
Stopping mongod: [ OK ]
# service mongod start
Starting mongod: forked process: 7131
all output going to: /data/mongo/log/mongod.log
[ OK ]
what is the output of " chkconfig | grep mongo " on your system?
if you don't get any output from the command above, then you still need to correctly configure mongod as a service with "chkconfig" (see 'man chkconfig')
e.g.:
chkconfig --add mongod
chkconfig --level 35 mongod on
afterwards you should get this output:
# chkconfig | grep mongo
mongod 0:off 1:off 2:off 3:on 4:off 5:on 6:off
# service mongod status
mongod (pid 6403) is running...
Bug has been reported and fixed.
https://jira.mongodb.org/browse/SERVER-2200
$ sudo apt-get purge mongodb-stable $ sudo apt-get install mongodb-stable (remove the lock file if present in /var/lib/mongodb) $ sudo init 6
Then edit /etc/init/mongodb.conf removing the line "limit nofile 20000"
$ sudo vi /etc/init/mongodb.conf $ sudo service mongodb start mongodb start/running, process 2351
Worked.
If process is not running but you still get this exeption - just delete "mongodb.lock" file in your mongodb/data folder
I run ubuntu server 10.04 minimal installation in a chroot environment. I always have same massage even after I executed the above. Only the following sudo mongod -f /etc/mongodb.conf
works, any hints?
In shell launching $ mongo
and # mongo
I was able to find out that
/data/db
is not present sudo mkdir -p /data/db
sudo start --system mongod
(valid for Ubuntu 14.04 trusty)