Import the MongoDB repository's public key.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Create a list file for MongoDB.
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
Reload the local package database.
sudo apt-get update
Install the MongoDB packages:
sudo apt-get install -y mongodb-org
Notice that each package contains the associated version number.
Once the installation completes you can start, stop, and check the status of the service. It will start automatically after installation.
Try to connect to the MongoDB instance running as service:
mongo
If it is up and running, you will see something like this:
MongoDB shell version: 2.6.9
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
This means the database server is running! You can exit now:
exit
No comments:
Post a Comment