Install MongoDB 2.4.4 on Fedora 18/17, CentOS/Red Hat (RHEL) 6.4/5.9


What is MongoDB?

MongoDB (from “humongous”) is a scalable, high-performance, open source, schema-free, document-oriented database. Written in C++. MongoDB bridges the gap between key-value stores (which are fast and highly scalable) and traditional RDBMS systems (which provide structured schemas and powerful queries).

MongoDB is very interesting document-oriented database, because it has really awesome features:

  • Document-oriented storage (the simplicity and power of JSON-like data schemas)
  • Dynamic queries
  • Full index support, extending to inner-objects and embedded arrays
  • Query profiling
  • Fast, in-place updates
  • Efficient storage of binary data large objects (e.g. photos and videos)
  • Replication and fail-over support
  • Auto-sharding for cloud-level scalability
  • MapReduce for complex aggregation
  • Commercial Support, Training, and Consulting

This guide shows howto install MongoDB 2.4.4 on Fedora 18/17/16/15/14/13/12, CentOS 6.4/6.3/6.2/6.1/6/5.9 and Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9. Using MongoDB own YUM repositories. Fedora / CentOS / Red Hat (RHEL) RPM packages are currently available for x86 (32-bit) and x86_64 (64-bit) architectures.

1. Install MongoDB on Fedora 18/17/16/15/14/13/12, CentOS 6.4/5.9 and Red Hat (RHEL) 6.4/5.9

1.1 Change to root User

1.2 Add and enable 10gen MongoDB repository

Select suitable repo for your system and add one of following to /etc/yum.repos.d/10gen-mongodb.repo

Mongodb-repo for Fedora 18/17/16/15/14/13/12, CentOS 6.4/5.9 and Red Hat (RHEL) 6.4/5.9 on i686 (32-bit)

Mongodb-repo for Fedora 18/17/15/14/13/12, CentOS 6.4/5.9 and Red Hat (RHEL) 6.4/5.9 on x86_64 (64-bit)

1.3 Install mongo server and mongo client packages

Install stable version of MongoDB

2. Configure MongoDB Database Server

2.1 Edit /etc/mongod.conf file:

2.2 Check and set basic settings, before starting MongoDB (default settings are good)

2.3 Start MongoDB Server

2.4 Start MongoDB on boot

3. Test MongoDB Server

3.1 Open MongoDB Command Line Client

3.2 Save, Update and Find Some Test Data on MongoDB

4. Open MongoDB Port (27017) on Iptables Firewall (as root user again)

Edit /etc/sysconfig/iptables file:

4.1 Add following line before COMMIT:

4.2 Restart Iptables Firewall:

Note: Open MongoDB port only if you have enabled authentication or operating trusted environment.

4.3 Test remote connection

Share this post

28 Comments

  1. Hi,

    Nice tutorial.
    But I am running into a dependency problem while running the yum installation.
    Error:
    ———————————————————————————————-
    –> Processing Dependency: /bin/sh for package: mongo-10gen-server-2.4.4-mongodb_1.x86_64
    –> Finished Dependency Resolution
    mongo-10gen-server-2.4.4-mongodb_1.x86_64 from 10gen has depsolving problems
    –> Missing Dependency: /bin/sh is needed by package mongo-10gen-server-2.4.4-mongodb_1.x86_64 (10gen)
    Error: Missing Dependency: /bin/sh is needed by package mongo-10gen-server-2.4.4-mongodb_1.x86_64 (10gen)
    —————————————————————————————————
    But I see that sh executable is already present in the /bin directory.
    Could you please help me on this?

    Thanks,
    Deepak

    Reply
    • Hi Deepak,

      Could you first post output of following commands:

      Reply
  2. Hi JR,

    Please find the details below:

    Reply
  3. JR,

    Thanks for the help.
    I was doing a silly mistake. Got it.
    Thanks,
    Deepak

    Reply
    • Hi Deepak,

      Okay, nice to hear that you got it working. Btw. this is not best method install mongodb on Ubuntu.

      Reply
  4. Hello, thanks for great tutorial, I tried alot of tutorials this one is simplest and easiest one.

    Let people know that I was already shut down my iptables due to I have already ddos protection so when I restarted iptables accidently everything stop working, so guys dont forget to check other iptables rules.

    Cheers.

    Reply

Trackbacks/Pingbacks

  1. Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … | Software Firewall - [...] original post here: Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … Share and …
  2. Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … | TuxWire : The Linux Blog Aggregator - [...] Read the rest here: Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … [...]
  3. Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … | Just linux! - [...] See the rest here: Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux … [...]
  4. Jose da Silva » Blog Archive » MongoDB and PHP - [...] You can follow the great step-by-step article over at If Not True Than Else blog. [...]
  5. mongoDB調査メモ | tonbyブログ - [...] Howto Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux http://www.if-not-true-then-false.com/2010/03/howto-install-mongodb-on-centos-linux-and-red-hat-rhel... [...]
  6. Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux | if not … | Software Firewall - [...] more here: Install MongoDB on CentOS Linux and Red Hat (RHEL) Linux | if not … Share …
  7. Eat.Write.Code. » Blog Archive » MongoDB (Sorta Quickstart Guide) - A blog about eating, writing, and coding. And eating while writing code. Plus some other stuff. - [...] to share some information for those of you starting MongoDB to help save you some time. Read this blog …

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">