I tried to find this info everywhere and couldn't find it. I already change mongodb.conf so I forget where the original directory is.
4 Answers
When you are searching a file in your filesystem while you are running Ubuntu a very easy way to find it is to do the following:
Update the database with your files (may be a bit slow, depending on when it run the last time automatically from your system):
sudo updatedb
Search for the corresponding file (super quick):
locate mongodb.conf
The config file name has recently change, now use locate mongod.conf
(no more "b") (or just locate '*mongo*.conf'
, if you aren't sure).
Note: In the latest mongodb versions, the configuration file has been renamed to mongod.conf
-
The config file name has recently change, now use "locate mongod.conf" (no more "b") May 21, 2016 at 21:49
-
-
1@OddDev the file has been renamed to
mongod.conf
. In my installation it's placed at/etc/mongod.conf
– hytromoSep 7, 2017 at 14:59
I'm not sure for amazon ec2 exactly but on my machine it is located at /var/lib/mongodb
You can find MongoDB configuration: locate 'mongo.conf' Also this is the MongoDB resource: https://docs.mongodb.com/manual/reference/configuration-options/
-
1Welcome to Ask Ubuntu! Welcome to Ask Ubuntu! Please add appropriate citations when your answer incorporates a part of another answer. For discussion about why see this meta question. If your answer would not stand on its own consider: suggesting an edit, or expanding your answer. Jan 13, 2018 at 3:06
IMO finding files with locate isn't the best approach, since you have to know the identical name of the file you're searching
Try instead
find / -name 'mondo*.conf'
-
Have you looked at
locate
's manpage? It supports both wildcards and regular expressions.– muruMay 22, 2016 at 16:41 -
You are right, I haven't - yet you could've gave an example of its usage in the same scenario. May 22, 2016 at 17:00
-
-
This is also good answer, not every developer has sudo permission to run
sudo updatedb
– WattJun 22, 2017 at 19:42