Where do I find a MongoDB PID?

Viewed 1906

Where can I find the process ID for a mongo database? I have tried to search it up but, I cannot find anything on stack overflow that answer this question. Do I use the MongoDB terminal or any command or can I find it on the website itself?

2 Answers

Try these two commands:

pidof mongod
pgrep mongod

You can run mongod with the parameter --pidfilepath to specify the file where the process ID will be stored.

See mongod --help for details:

--pidfilepath arg                     Full path to pidfile (if not set, no 
                                      pidfile is created)
Related