Nupur Dave
Nupur Dave

Reputation: 43

Where do I find a MongoDB PID?

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?

Upvotes: 3

Views: 5475

Answers (3)

Run the top command on your terminal if you are using Mac to find the list of all ids of processes including mongo database:

Upvotes: 0

Timotheus Pokorra
Timotheus Pokorra

Reputation: 353

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)

Upvotes: 0

strausd
strausd

Reputation: 441

Try these two commands:

pidof mongod
pgrep mongod

Upvotes: 4

Related Questions