I'd like to use a relative path for mongodb, so that each user has a separate data directory when running mongo.
I've tried setting
dbpath = ~/mongodb_data
in my config file, but for some reason that doesn't seem to work - I'm getting:
ERROR: dbpath (~/mongodb_data) does not exist.
At first I thought it might be a permissions error, but I'm running mongod under a user that has rw to ~/mongodb_data.
Is what I'm trying to do feasible, and, if so, how do I get to doing it?
The default dbpath for mongodb is /data/db . There is no default config file, so you will either need to specify this when starting mongod with: mongod --config /etc/mongodb.
For example, for Ubuntu this would be `/etc/mongod. conf` if you installed from the official MongoDB packages. Also is there a mongo command to give me the current path of the db (or config file). The default dbpath is /data/db.
MongoDB requires a data folder to store its files. The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt.
dbPath is /var/lib/mongodb; this setting specifies where MongoDB should store its files. systemLog. path is /var/log/mongodb/mongod. log; this is the path where mongod will write its output.
Hello blueberryfields,
I was able to do that just like that on my windows machine:
mongod --dbpath ..\..\data\db
You can use a symbolic link as well.
But as already mentioned, a update on users start up script is the best manageable solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With