Is mongodb running?

check with either:

ps -edaf | grep mongo | grep -v grep  # "ps" flags may differ on your OS

or

/etc/init.d/mongodb status     # for MongoDB version < 2.6

/etc/init.d/mongod status      # for MongoDB version >= 2.6

or

service mongodb status         # for MongoDB version < 2.6

service mongod status          # for MongoDB version >= 2.6

to see if mongod is running (you need to be root to do this, or prefix everything with sudo). Please note that the ‘grep’ command will always also show up as a separate process.

Check the log file /var/log/mongo/mongo.log to see if there are any problems reported.

Leave a Comment