Question

I am trying to install mongodb on Ubuntu 14.04. I am new to linux. I figured out how to install ubuntu and become su to the root as well as how to set up environment path

I am just wondering where exactly the default path suppose to be for mongodb. should I use root and put the data/db in the root directory?

When I install the mongo db it tell me to run the sudo mongo install (don't remember exactly what the command is) it runs and installs, A mongodb folder then appears in the system where etc folder is. also there is a folder in /var/lib/mongodb.

also I have to chmod 777 for the data/db I don't think I was able to do this.

So where exactly data/db suppose to reside by default?

Was it helpful?

Solution

You should take a look at mongod.conf file.

Default working directory should be "/data/db" - if is now exist - just create is. No need to chmod 777 if you create the directory and run mongo as root user.

If you want to start mongod with other working directory - modify mongod.conf file or start mongod with --dbpath /pathtootheremptyfolder/

Please let me know if you are OK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top