Website Scripts And Cloud Tutorials

How to find MongoDB Configuration in Linux

Byadmin

May 5, 2015

Last updated on March 3rd, 2022 at 05:01 pm

Click to rate this tutorial!
[Total: 0 Average: 0]

Mongodb is a document based database. It doesn’t have Rows & Tables like RDMS instead they have Documents and Collections.

For finding where the data (dbpath), logpath and pidpath in MongoDB running on a linux environment,First we need to figure out where the mongod.conf file is located. Use the command below

[[email protected]~]# ps -ef|grep mongo 
mongod 15427 1 0 17:38 ? 00:00:00 /usr/bin/mongod -f /etc/mongod.conf
[[email protected]~]#

Use VI editor or CAT command to see the content of the mongod.conf file.

#where to log
logpath=/var/log/mongodb/mongod.log
 
dbpath=/var/lib/mongo
 
# location of pidfile
pidfilepath=/var/run/mongodb/mongod.pid

logpath will give you the log file location.

dbpath will give you the location where data is stored

pidfilepath will have the process id file location.

There are also other also other configuration values inside this conf file.

You can also change dbpath using the option –dbpath.

Click to rate this tutorial!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published.