0

I have installed a mongodb on my ubuntu and to my surprise mongodb is looking in the wrong data directory.

In in mongod.conf it says: storage: dbPath: /var/lib/mongodb

However, when I start the mongod serve from my terminal it says: exception in initAndListen: 29 Data directory /data/db not found., terminating

Any suggestions why my mongodb is not correctly loading the config file?

Nickpick
  • 6,163
  • 16
  • 65
  • 116
  • Try providing DB path using --dbpath attribute while starting mongoDB – Akhil Feb 16 '17 at 09:04
  • Are you using the default conf file `/etc/mongodb.conf` or have you named it something else. – Blakey Feb 16 '17 at 09:07
  • With --dpath I can make it point to the right folder but I want the config file to work correctly. Yes the config file is in the default folder /etc/mongod.conf. – Nickpick Feb 16 '17 at 09:20
  • how is it possible that it works when I do sudo mongod -f /etc/mongod.conf but when launching it with sudo service mongod start I get an error in the log Assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 267 – Nickpick Feb 16 '17 at 22:29

0 Answers0