Install MongoDB on Ubuntu 14.04
In modern web applications, the major issue arises with managing data, since its growth rate is almost exponential. To handle this situation you need a scalable database. MongoDB is a scalable, open source, high performance, document oriented database. MongoDB falls under the broader category called NoSQLb databases. This post focuses on how to install MongoDB and the Next post is about How to take backup of MongoDB database and store it to S3.
Lets start with the Installation process. First
you are required to have machine with Ubuntu 14.04 LTS (Long Term
Services) installed. Now go with following steps:
- Import Public KeyThis step will import the MongoDB GPG public key. This step is required for authenticity of software packages by verifying that they are signed with GPG keys.So run:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- Create a List FileTo inform APT, from where to download the packages, you will need to add MongoDB repository details. Following command will create a list for MongoDB.Run:
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
- Update Package listAfter adding the repository details, you are required to update the packages list.So run:
sudo apt-get update
- Install MongoDBNow, you are ready to install MongoDB. Following command will install latest stable version of MongoDB and other helpful management tools required for MongoDB server.Run:
sudo apt-get install -y mongodb-org
- Verify
Above command will start
MongoDB automatically. To check run:service mongod status
you will get mongod running status with process ID.
Some useful command for MongoDB:
- To start MongoDB:
service mongod start
- To stop MongoDB:
service mongod stop
- To restart MongoDB:
service mongod restart
Congratulations! You have installed MongoDB.
Backups
If you are worried about backups than mongodump is the solution. Here is the complete way to take backup of mongodb and store it to S3 with a cron.
References:
- http://irohinichoudhary.blogspot.in/2015/01/mongodb.html
0 comments:
Post a Comment