MongoDB – Commands to Check the Status of MongoDB Database

0
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 has been recently working in the area of AI and machine learning. Currently, his research area includes Safe & Quality AI. In addition, he is also passionate about various different technologies including programming languages such as Java/JEE, Javascript and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.