How to install MongoDB on RHEL/Centos/Fedora Server

How to install MongoDB on RHELCentos Fedora Server
Social sharing

Introduction to MongoDB:-

MongoDB is an open source schema less database system which provides a document-oriented data model. The prime concern was that MySQL is written using SQL queries, while MongoDB is focused on BSON (Binary JSON). It is a cross-platform NoSQL database. It is table based relational database structure in favor of json like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster. MongoDB is free and open-source software.

So let’s see the steps to install mongoDB on RHEL/Centos or Fedora Server.

How-to-install-MongoDB-on-RHELCentos-Fedora-Server

Installation procedure:-

Step: 1  System Login as root user. We are checking system OS type and system bit type.

 # uname –a
   # cat /etc/issue

Step: 2  Now we are creating a yum repo file .like /etc/yum.repos.d/mongodb.repo

# vi /etc/yum.repos.d/mongodb.repo

For we are using as 64 bit System:

[mongodb]
name=mongodb Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1

For we are using as 32 bit System:

[mongodb]
name=mongodb Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
gpgcheck=0
enabled=1

Step:3  Now we install MongoDB client and server using Yum

       # yum install mongo mongo-server

Step:4  Now we can configure and basic setting in MongoDB Database Server

       # vi /etc/mongod.conf
       logpath=/var/log/mongo/mongod.log
       port=27017
       dbpath=/var/lib/mongo

Step:5  Start MongoDB Server

       # /etc/init.d/mongod start

Step:6  Start MongoDB Server on system boot time

       # chkconfig mongod on

Step:7  Test MongoDB server

# mongo
   	> use test
   	switched to db test
  	> db.test.find()
 	> db.test.save({sd: 1})
	> db.test.find()
  	{ "_id" : ObjectId("4b9ef53c4f450969bb35a1a9"), "sd" : 1 }
   > db.test.update( {sd: 1}, {sd: 5})
   > db.test.find()
 	{ "_id" : ObjectId("4b9ef53c4f450969bb35a1a9"), "sd" : 5 }

 

Conclusion:-

MongoDB has an official driver for a variety of popular programming languages and development environments.

We at Andolasoft having vast expertise on implementing MongoDB database as backend in several cutting edge applications. We have developed many apps like OrangeGigs, SQUADZ  by using MongoDB as backend.

You can also see: How to Import csv configuration file to device’s SQLite db

Hope it will be helpful for you. I’d love to hear about your thoughts on this.
Thank you for your Interest.

Your recently viewed posts:

Jayadev Das - Post Author

Do what you do best in – that’s what I’ve always believed in and that’s what I preach. Over the past 25+ years (yup that’s my expertise ‘n’ experience in the Information Technology domain), I’ve been consulting to small, medium and large companies ‘About Web Technologies, Mobile Future as well as on the good-and-bad of tech. Blogger, International Business Advisor, Web Technology Expert, Sales Guru, Startup Mentor, Insurance Sales Portal Expert & a Tennis Player. And top of all – a complete family man!

    Contact Us

    We’d love to help & work with you




    When do you want to start ?


    Enter your email address to stay up to date with the latest news.
    Holler Box

    Orange Exit pop up

    Subscribe for the latest
    trends in web and
    mobile app development
    Holler Box

    Exit pop up

    Sad to see you leaving early...

    From "Aha" to "Oh shit" we are sharing everything on our journey.
    Enter your email address to stay up to date with the latest news.
    Holler Box