Hi there,
I've been trying to set up a mongodb instance (2.6.11) on my CentOS 6.3 to use a data location on a different drive because of space constraints on the default location of /var/lib/mongo
I've changed the dbpath parameter in /etc/mongo.conf and created the appropriate location on the alternate location, e.g. /mnt/newdrive/mongo
I've set the user and group to mongod with
chown -R mongod:mongod /mnt/newdrive/mongo
If I start the daemon using the commands
sudo service mongod start
/etc/init.d/mongod start
the starting fails with permission denied when accessing the new data location.
If I start with
sudo mongod --config /etc/mongo.conf
The process starts happily, though, to shut it down I need to issue
sudo mongod --config /etc/mongo.conf --shutdown
as the service/init.d scripts don't work.
The same issue is apparent when creating a symlink /mnt/newdrive/mongo -> /var/lib/mongo instead of changing the configuration (the 'permission denied' error, in that case, is on the symlink).
The new drive is already accessible by different accounts for other purposes and it's properly mounted.
It seems that it might be a problem with the init.d script rather than the configuration.
Any idea what might be afoot?
Many thanks,
Alberto