Skip to content

Instantly share code, notes, and snippets.

@slgithub
Last active September 7, 2015 07:19
Show Gist options
  • Save slgithub/eb029059a9743ae0094c to your computer and use it in GitHub Desktop.
Save slgithub/eb029059a9743ae0094c to your computer and use it in GitHub Desktop.
check mongodb is running

check with either:

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

/etc/init.d/mongod status or

service mongod status to see if mongod is running (you need to be root to do this, or prefix everything with sudo)

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

For quickly checking if mongodb is running, this quick nc trick will let you know.

nc -zvv localhost 27017

The above command assumes that you are running it on the default port on localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment