MongoDB – Commands to Check the Status of MongoDB Database

This article represents different commands which can be used to check the status of MongoDB database on Linux/Ubuntu. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.
Note that mongod represents the daemon process of MongDB databass and, primarily, used to manage database access. Following are some of the commands which can be used to get the status of Mongodb:

  • service mongod status: Displays the status of MongodB service as like the screenshot given below.
    MongoDB Status Check

    Fig 1. MongoDB Status Check

  • systemctl status mongod: Displays the same status of MongoDB service as like above command as shown in figure 1.
  • pgrep mongo: Prints the process ID of running mongo instance.¬†pgrep command looks through the list of running processes and list down the process ids based on name.
  • ps -e | grep mongo: Prints the process detail of running mongo instance
  • nc -v localhost 27017: Prints whether connection to mongodb running on port 27017 is succeeded.
Ajitesh Kumar

Ajitesh Kumar

Ajitesh is passionate about various different technologies including programming languages such as Java/JEE, Javascript, PHP, .NET, C/C++, mobile programming languages etc and, computing fundamentals such as application security, cloud computing, API, mobile apps, google glass, big data etc.Recently, he has been digging deep into the field of data science and machine learning.

Follow him on Twitter and Google+.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.