Install MongoDB on Amazon Linux | MongoDB

MongoDB is an open-source, cross platform, highly scalable and flexible database. The main key feature is on the MongoDB which goes with NoSQL, therefore the data can be stored as documents or the collections, Those collections can be restored as JSON format as well. Therefore MongoDB is a using mostly in enterprise level environments.
Installation of MongoDB is straight forward, and this tutorial describes about the

  1. Log in to the AWS console, provision an EC2 instance with Amazon AMI.
  2. Update the yum.repo.d/mongoDB-v4.0.repo file for download the v4.0 in MongoDB.
    [mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
  3. To update update yum repo in the servers issue the following command.yum update
  4. Once you are done with the repo update, issue the yum install for install the MongoDB server. Once you issue this commands, it automatically install the all packages relate to MongoDB server.
    sudo yum install -y mongodb-org
  5. Issue the following command to start the mongoDB service once you are done with the installation.
    sudo service mongod start
  6. Configure mongoDB service to start it automatically at the reboot.
    sudo chkconfig mongod on

Installation is now completed, user can log in to the MongoDB. Since we don’t have configured mongoDB for authentication, we can directly log in to the mongoDB using following command.
mongo --host 127.0.0.1:27017

If you see the mongoDB console, then you are done successfully. Enjoy 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s