MongoDB

From ArchWiki
Revision as of 11:17, 23 January 2013 by Azd325 (Talk | contribs) (MongoDB won't more to start: Include somemore troubleshooting)

Jump to: navigation, search

MongoDB (from "humongous") is a scalable, high-performance, open source NoSQL database.

Installing MongoDB

Install mongodb

# pacman -S mongodb

Start MongoDB

# systemctl start mongodb

(Optional) Add MongoDB to the list of daemons that start on system startup

# systemctl enable mongodb

Access the database shell

To access the Database shell you have type in your terminal

# mongo

Troubleshooting

MongoDB won't more to start

Check for the lock file

# ls  -lisa /var/lib/mongodb

If the are there stop the mongodb daemon delete the file after it star the daemon again

# rm /var/lib/mongodb/mongod.lock

If still problems are there please check with the repair parameter (/var/lib/mongodb/ is the default --dbpath from Arch Linux)

# mongod --dbpath /var/lib/mongodb/ --repair

Sometimes it can happen that you can't start mongodb if the user and group policy wrong. You can check it with ls -al

# cd /var/log/mongod
# sudo chown -R mongodb:mongodb .
# cd /var/lib/mongodb
# sudo chown -R mongodb:mongodb .