Install MongoDB on Ubuntu
1. Create a list file for MongoDB.
Create the /etc/apt/sources.list.d/mongodb.list list file using the following command
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
' | sudo tee /etc/apt/sources.list.d/mongodb.list
2. Reload local package database.
sudo apt-get update
3. Install the MongoDB packages.
You can install either the latest stable version of MongoDB or a specific version of MongoDB.
4. Install the latest stable version of MongoDB.
sudo apt-get install -y mongodb-org
The MongoDB instance stores its data files in /var/lib/mongodb and its log files in /var/log/mongodb by default, and runs using the mongodb user account. You can specify alternate log and data file directories in /etc/mongod.conf
5. Start MongoDB.
sudo service mongod start
No comments:
Post a Comment