How to I get mongo to use a mounted drive on ec2? I really do not understand. I attached a volume on ec2 formatted the drive as root and start as root and yet as root I ca
I got the same issue when I ran mongod command after installing it on Windows10. I stopped the mongodb service and started it again. Working like a charm
Command to stop mongodb service (in windows): net stop mongodb
Command to start mongodb server: mongod --dbpath PATH_TO_DATA_FOLDER
In Centos Server
this works for me
chown -R mongod:mongod /var/lib/mongo
Got a similar error, fixed with removing all records (in my case directory journals
, and file mongo.lock...
), after that check port with sudo lsof -i:27017
, if smth running on it kill <PID of the process>
, and try to run ./mongod
again
I installed mongodb with EBS on an EC2 with Ubuntu 14.04 following this tutorial:
http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/
But instead of the suggested chown I did:
sudo chown -R mongodb:mongodb /data /log /journal
To fix the problem
For mac users:
Run ls -ld /data/db/
Output should be something like drwrx-xr-x 20 singh wheel 680 21 Jul 05:49 /data/db/
Where singh is the owner and wheel is the group it belongs to.
Run sudo chown -R singh:wheel /data/db
Run mongod
Do ls -la
to know the user and group of /var/log/mongodb.
Then do sudo chown -R user:group /data/db
Now run sudo service mongodb start
.
Check the status with sudo service mongodb status