MongoDB is currently the most common nosql-non-relational database.
This article will show you how to install MongoDB with Yum under CentOS.
1. First, under CentOS6.5, edit the MONGO yum Source:
Under/ETC/YUM.REPO.D, edit Mongo.repo
Vim Mongo.repo
[Mongodb-enterprise]
Name=mongodb Enterprise Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
Gpgcheck=0
Enabled=1
2. Find the relevant software for MongoDB:
Yum Search MONGO
Yum Search MONGO
Loaded Plugins:fastestmirror, security
Loading mirror speeds from cached hostfile
============================================================================================== N/S Matched:mongo ===============================================================================================
Python-mongoengine.noarch:a Python Document-object Mapper for working with MongoDB
Almas-mongolian-title-fonts.noarch:mongolian Title Font
NODEJS-MONGODB.NOARCH:A node driver for MongoDB
php-pecl-mongo.x86_64:php MongoDB Database Driver
Python-asyncmongo.noarch:an Asynchronous Python MongoDB Library
Python-flask-mongoengine.noarch:flask extension that provides integration with Mongoengine
Python-pymongo.x86_64:python Driver for MongoDB
Hunspell-mn.noarch:mongolian Hunspell Dictionaries
Hyphen-mn.noarch:mongolian Hyphenation Rules
Libmongodb.x86_64:MongoDB Shared libraries
Libmongodb-devel.i686:mongodb Header Files
Libmongodb-devel.x86_64:mongodb Header Files
Mongo-10gen.x86_64:mongo Client shell and tools
Mongo-10gen-server.x86_64:mongo server, sharding server, and support scripts
Mongo-10gen-unstable.x86_64:mongo Client shell and tools
Mongo-10gen-unstable-mongos.x86_64:mongodb sharding Server
Mongo-10gen-unstable-server.x86_64:mongo server, sharding server, and support scripts
Mongo-10gen-unstable-shell.x86_64:mongodb Shell
Mongo-10gen-unstable-tools.x86_64:mongodb Utilities
Mongo18-10gen.x86_64:mongo Client shell and tools
Mongo18-10gen-server.x86_64:mongo server, sharding server, and support scripts
Mongo20-10gen.x86_64:mongo Client shell and tools
Mongo20-10gen-server.x86_64:mongo server, sharding server, and support scripts
Mongodb-org.x86_64:mongodb cross-platform document-oriented Database System (metapackage)
Mongodb-org-mongos.x86_64:mongodb sharding Router
MONGODB-ORG-SERVER.X86_64:MONGODB Database Server
Mongodb-org-shell.x86_64:mongodb Shell Client
MONGODB-ORG-TOOLS.X86_64:MONGODB Tools
Mongodb-org-unstable.x86_64:mongodb server, Shell, sharding server and tools
Mongodb-org-unstable-mongos.x86_64:mongodb sharding Server
Mongodb-org-unstable-server.x86_64:mongodb Server and Support scripts
Mongodb-org-unstable-shell.x86_64:mongodb Shell
Mongodb-org-unstable-tools.x86_64:mongodb Utilities
Mongodb-server.x86_64:mongodb server, sharding server and support scripts
Mongoose-devel.i686:header files and development libraries for mongoose
Mongoose-devel.x86_64:header files and development libraries for mongoose
Mongoose-lib.i686:shared Object for Applications this use mongoose embedded
Mongoose-lib.x86_64:shared Object for Applications this use mongoose embedded
Php-horde-horde-mongo.noarch:horde Mongo Configuration
Pymongo.x86_64:Python Driver for MongoDB
Pymongo-gridfs.x86_64:python Gridfs driver for MongoDB
Python-pymongo-gridfs.x86_64:python Gridfs driver for MongoDB
Autocorr-mn.noarch:mongolian auto-correction Rules
Eclipse-nls-mn.x86_64:eclipse/babel Language Pack for Mongolian
Mongodb.x86_64:high-performance, Schema-free document-oriented database
mongodb-mms-backup-agent.x86_64:the MMS Backup Agent
mongodb-mms-monitoring-agent.x86_64:the MMS Monitoring Agent
Mongoose.x86_64:An easy-to-use Self-sufficient Web server
?
Name and summary matches only, use ' Search all ' for everything.
Mongodb-org begins with the related software found by the source you just added.
3. Installing MongoDB
Using Yum to install MongoDB:
Yum Install-y mongodb-org-y
Loaded Plugins:fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--Running Transaction check
---> Package mongodb-org.x86_64 0:2.6.12-1 'll be installed
--Processing Dependency:mongodb-org-shell = 2.6.12 for package:mongodb-org-2.6.12-1.x86_64
--Processing Dependency:mongodb-org-server = 2.6.12 for package:mongodb-org-2.6.12-1.x86_64
--Processing Dependency:mongodb-org-tools = 2.6.12 for package:mongodb-org-2.6.12-1.x86_64
--Processing Dependency:mongodb-org-mongos = 2.6.12 for package:mongodb-org-2.6.12-1.x86_64
--Running Transaction check
---> Package mongodb-org-mongos.x86_64 0:2.6.12-1 'll be installed
---> Package mongodb-org-server.x86_64 0:2.6.12-1 'll be installed
---> Package mongodb-org-shell.x86_64 0:2.6.12-1 'll be installed
---> Package mongodb-org-tools.x86_64 0:2.6.12-1 'll be installed
--Finished Dependency Resolution
?
Dependencies resolved
?
=============================================================================================================== ==================================================================================================
Package Arch Version Repository Size
=============================================================================================================== ==================================================================================================
Installing:
mongodb-org x86_64 2.6.12-1 mongodb-enterprise 4.6 k
Installing for dependencies:
Mongodb-org-mongos x86_64 2.6.12-1 mongodb-enterprise 6.9 M
Mongodb-org-server x86_64 2.6.12-1 mongodb-enterprise 9.1 M
Mongodb-org-shell x86_64 2.6.12-1 mongodb-enterprise 4.3 M
Mongodb-org-tools x86_64 2.6.12-1 mongodb-enterprise M
?
Transaction Summary
=============================================================================================================== ==================================================================================================
Install 5 Package (s)
?
Total Download size:110 M
Installed size:279 M
Downloading Packages:
(1/5): mongodb-org-2.6.12-1.x86_64.rpm | 4.6 KB 00:00
(2/5): mongodb-org-mongos-2.6.12-1.x86_64.rpm | 6.9 MB 00:39
(3/5): mongodb-org-server-2.6.12-1.x86_64.rpm | 9.1 MB 01:17
(4/5): mongodb-org-shell-2.6.12-1.x86_64.rpm | 4.3 MB 00:40
(5/5): mongodb-org-tools-2.6.12-1.x86_64.rpm | MB 08:09
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------
Total KB/S | MB 11:03
Running Rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:mongodb-org-server-2.6.12-1.x86_64 1/5
Installing:mongodb-org-mongos-2.6.12-1.x86_64 2/5
Installing:mongodb-org-tools-2.6.12-1.x86_64 3/5
Installing:mongodb-org-shell-2.6.12-1.x86_64 4/5
Installing:mongodb-org-2.6.12-1.x86_64 5/5
Verifying:mongodb-org-shell-2.6.12-1.x86_64 1/5
Verifying:mongodb-org-tools-2.6.12-1.x86_64 2/5
Verifying:mongodb-org-mongos-2.6.12-1.x86_64 3/5
Verifying:mongodb-org-server-2.6.12-1.x86_64 4/5
Verifying:mongodb-org-2.6.12-1.x86_64 5/5
?
Installed:
Mongodb-org.x86_64 0:2.6.12-1
?
Dependency installed:
mongodb-org-mongos.x86_64 0:2.6.12-1 mongodb-org-server.x86_64 0:2.6.12-1 mongodb-org-shell.x86_64 0:2.6.12-1 Mongodb-org-tools.x86_64 0:2.6.12-1
?
complete!
Installing MongoDB under CentOS6.5