from:http://tecadmin.net/install-mongodb-on-centos-rhel-and-fedora/
MongoDB (named from "Humongous") are a full flexible index support and rich queries database. It is a NoSQL database. MongoDB provides large media storage with Gridfs. Clickhere for more details about MongoDB.
MongoDB has released new stable version 3.2 with lots of major enhancements. This tutorial is to the install MongoDB 3.2.X on CentOS, RHEL and Fedora Systems.
Step 1–add MongoDB Yum Repository
Add following content in Yum repository configuration File/etc/yum.repos.d/mongodb.repo as per your required mongodb vers Ion and system architecture. For the article we are using MongoDB 3.2 repository.
For 64bit Systems:
[Mongodb]name=mongodb repositorybaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ Gpgcheck=0enabled=1
Step 2–install MongoDB Server
Lets Use the Yum Package Manager to the install mongodb-org package, it'll automatically install all its dependencies. To install any specific revision of the MongoDB specify package name with the version like mongodb-org-3.2.0. Following command would install latest stable version available.
# yum Install mongodb-org
Step 3–start MongoDB
Package Mongodb-org-server provided MongoDB init script, use the script to start service.
#/etc/init.d/mongod Restart
Configure MongoDB to auto start on system boot.
# Chkconfig Mongod on
Step 4–check MongoDB Version
Use following command to check installed MongoDB version
[Email protected] ~]# mongod--versiondb version v3.2.0git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7openssl Version:openssl 1.0.1e-fips 2013allocator:tcmallocmodules: Nonebuild Environment: distmod:rhel70 distarch:x86_64 target_arch:x86_64
Connect MongoDB using command line and execute some test commands for checking proper working.
[[email protected] ~]# mongo> use mydb;> db.test.save ({a:1}) > Db.test.find () {"_id": ObjectId ("54f C2a4c71b56443ced99ba2 ")," a ": 1}
Congratulation ' s you have successfully installed MongoDB server on your system. For practice only, use MongoDB browser shell.
References:
http://docs.mongodb.org/manual/installation/
Go: How to Install MongoDB 3.2 on Centos/rhel & Fedora (easy to understand)