ubuntu - MongoDB service doesn't start. errno:13 Permission denied -


i have installed mongodb on ubuntu server indicated in docs http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/. then, have modified configuration file /etc/mongod.conf for, later, run mongod service.

mongodb runs correctly if execute:

sudo mongod -f /etc/mongod.conf 

but mongodb stops if execute:

sudo service mongod start 

in config file /etc/mongod.conf changed this:

dbpath=/data/db logpath=/root/logs/mongod.log port=20000 

with configuration, log file not created too.

if don't modify previous values indicated, service starts correctly. default values are:

dbpath=/var/lib/mongodb logpath=/var/log/mongodb/mongod.log port = 27017 

because log file not created custom configuration, have changed dbpath see error:

[initandlisten] exception in initandlisten: 10309 unable create/open lock file: /data/db/mongod.lock errno:13 permission denied mongod instance running? 

i tried run following commands without success:

sudo chown -r `id -u` /data/db  sudo rm /var/lib/mongodb/mongod.lock mongod --repair 

stack:

  • ubuntu 14.10
  • mongodb 2.6.5

we must make directories/files owned mongod user. this:

sudo chown -r mongodb:mongodb /data/db 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -