How to Install Latest MongoDB (2.0.3) on CentOS 6 / RHEL 6

MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas. The goal of MongoDB is to bridge the gap between key-value stores (which are fast and scalable) and relational databases (which have rich functionality). Binaries are available for WindowsLinux, OS X, and Solaris, MongoDB is available for free under the GNU Affero General Public License. The language drivers are available under an Apache License. In addition, 10gen offers commercial licenses for MongoDB.  It’s network accessible, written in C++.

Features of MongoDB:

  • Collection oriented storage – easy storage of object-style data
  • Full index support, including on inner objects
  • Query profiling
  • Replication and fail-over support
  • Efficient storage of binary data including large
  • objects (e.g. videos)
  • Auto-sharding for cloud-level scalability (Q209)
  •  High performance, scalability, and reasonable depth of functionality are the goals for the project.

Here is the turorial about install latest MongoDB ( As of now MongoDB 2.0.3 ) on CentOS 6 / RHEL 6.

10gen publishes rpm packages. Their packages are generally fresher than those in the Fedora repositories.  It contains only stable releases, under the name mongo-10gen.

Open Terminal ( Application —> System Tools  —> Terminal).

Switch to root user.

[raj@geeksite~/]$ su

Installing MangoDB:

We need to add repository in our system, so add the following file under the /etc/yum.repos.d directory.

[root@geeksite~/]# vi /etc/yum.repos.d/mongodb.repo

Add the following line.

### 32 bit ###

name=10gen Repository

### 64 bit ###

name=10gen Repository

Install MongoDB.

[root@geeksite~/]# yum install mongo-10gen*

Controling MongoDB:

MongoDB can be start / stop by easy known commands.

Using normal init scripts.

[root@geeksite~/]# /etc/init.d/mongod start
[root@geeksite~/]# /etc/init.d/mongod stop

or using service command.

[root@geeksite~/]# service mongod start
[root@geeksite~/]# service mongod stop

Confirm the version of MongoDB.

raj@geeksite~/$ mongod --version
db version v2.0.3, pdfile version 4.5
Mon Mar  12 06:08:34 git version: 05bb8aa793660af8fce7e36b510ad48c27439697

That’s all. Now you have latest version of MongoDB installed on your machine.


Share This Post