Create a MongoDB database and set its path to a specific folder

I am using ubuntu 16.04! Is it possible to change the data directory for a specific database in mongo? I am trying to configure this recommendation engine , and I was asked to create a new MongoDB database and set its folder path.

+4
source share
3 answers

Preliminary version 3.0.0 , all databases in which one mongodhost must be in the same dbpath folder, which can be specified using command arguments using the flag --dbpathor file configuration.

However, can you run multiple mongods and host them separately? or on different ip / ports.

3.0.0 --directoryperdb (. https://docs.mongodb.com/manual/reference/program/mongod/#cmdoption--directoryperdb)

. -dbpath, .

+3

mongod.exe

mongod.exe --dbpath " "

.

+2

yes, maybe run the mongod process with the --dbpath option

+1
source

Source: https://habr.com/ru/post/1665599/


All Articles