0 votes
1 view
in SQL by (47.8k points)

My host came with a MongoDB instance and there is no /db directory so now I am wondering what I can do to find out where the data is actually being stored.

2 Answers

0 votes
by (107k points)

You can use the below-mentioned way to tell wg=here MongoDB is storing:-

By default, mongod sets the database location to /data/db/.

For checking by yourself you should run ps -xa | grep mongod and if you don't see a --dbpath which explicitly tells mongod to look at that parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location will be: /data/db/ and you should look there.

0 votes
by (77.9k points)

First, you have to see your configuration file:

$ grep dbpath /etc/mongodb.conf

Generally, your database files will be present on the list:

$ sudo lsof -p `ps aux | grep mongodb | head -n1 | tr -s ' ' | cut -d' ' -f 2` | grep REG

By default it gets stored at /var/lib/mongodb/* 

Note: There is a /var/lib/mongodb/mongod.lock file in MongoDB that basically holds the mongod PID.

Related questions

0 votes
2 answers
asked Sep 9, 2019 in SQL by Sammy (47.8k points)
0 votes
3 answers
0 votes
2 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...