How To Install MongoDB on CentOS 6

Posted on January 21, 2014 by J. Mays | Updated: January 22, 2014
Category: Technical Support | Tags: auto-shardingcentoscentos 6core manageddynamic schemashigh availabilitymongodbnosqlreplication

MongoDB is a NoSQL database intended for storing large amounts of data in document-oriented storage with dynamic schemas. NoSQL refers to a database with a data model other than the tabular format used in relational databases such as MySQL, PostgreSQL, and Microsoft SQL. MongoDB features include: full index support, replication, high availability, and auto-sharding.

Pre-Flight Check
  • These instructions are intended for installing MongoDB on a single CentOS 6 node.
  • I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root.
Step #1: Add the MongoDB Repository

For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor

vim /etc/yum.repos.d/mongodb.repo

Option A: If you are running a 64-bit system, add the following information to the file you’ve created, using <reference_page_text>i to insert:

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

Then exit and save the file with the command <reference_page_text>:wq . You should see an output very similar to the following image:

Option B: If you are running a 32-bit system, add the following information to the file you’ve created, using <reference_page_text>i to insert:

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

Then exit and save the file with the command <reference_page_text>:wq .

Step #2: Install MongoDB

At this point, installing MongoDB is as simple as running just one command:

yum install mongo-10gen mongo-10gen-server

When prompted <reference_page_text>Is this ok [y/N]: , simply type <reference_page_text>y and then hit the enter key. You should see an output very similar to the following image:

Step #3: Get MongoDB Running

Start-Up MongoDB

service mongod start

You should see an output very similar to the following image:

Check MongoDB Service Status

service mongod status

Summary List of Status Statistics

mongostat

Enter the MongoDB Command Line

mongo

You should see an output very similar to the following image:

By default, running this command will look for a MongoDB server listening on port 27017 on the localhost interface.

If you’d like to connect to a MongoDB server running on a different port, then use the –port option. For example, if you wanted to connect to a local MongoDB server listening on port 22222, then you’d issue the following command:

mongo --port 22222

Shutdown MongoDB

service mongod stop

There are many, many more things we could say about MongoDB, but those will be detailed in follow-up articles in the Liquid Web Knowledge Base! Look for articles on: <reference_page_text>How To Install MongoDB and Run a Multi-Node Cluster on CentOS 6 , <reference_page_text>Recommended Production Settings for MongoDB on CentOS 6 and more!

Be Sociable, Share!

How To Install MongoDB on CentOS 6的更多相关文章

  1. Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux

    Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux¶ Overview Use this tutorial t ...

  2. 转: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (简单易懂)

    from:  http://tecadmin.net/install-mongodb-on-centos-rhel-and-fedora/ MongoDB (named from “huMONGOus ...

  3. How To Install Java on CentOS and Fedora

    PostedDecember 4, 2014 453.8kviews JAVA CENTOS FEDORA   Introduction This tutorial will show you how ...

  4. Install MongoDB driver for PHP on XAMPP for Mac OSX

    试了不少方法,最后还是这个最有效. [转自:http://thatsimplecode.com/install-mongodb-driver-for-php-on-xampp-for-mac-osx] ...

  5. Install Redis on CentOS 6.4--转

    Install Redis on CentOS 6.4 source:http://thoughts.z-dev.org/2013/05/27/install-redis-on-centos-6-4/ ...

  6. Install ssdb-rocks on CentOS 6

    Install ssdb-rocks on CentOS 6 C.C.  发表于 2014年08月10日 20:14 | Hits: 649 为了优化节操精选的弹幕系统,打算更换到Facebook的R ...

  7. Steps to Install Hadoop on CentOS/RHEL 6---reference

    http://tecadmin.net/steps-to-install-hadoop-on-centosrhel-6/# The Apache Hadoop software library is ...

  8. Install MongoDB on Windows

    Overview Use this tutorial to install MongoDB on a Windows systems. PLATFORM SUPPORT Starting in ver ...

  9. Install MongoDB on Windows (Windows下安装MongoDB)

    Install MongoDB on Windows Overview Use this tutorial to install MongoDB on a Windows systems. PLATF ...

随机推荐

  1. Nodejs下express+ejs模板的搭建

    nodejs的环境配置,这里就不做说明了.在nodejs安装后的步骤在这里说明一下 首先 全局安装express  npm install -g express-generator 安装ok后,接着 ...

  2. CF1114B Yet Another Array Partitioning Task

    CF1114B Yet Another Array Partitioning Task 贪心,选择前 \(k*m\) 大的元素对答案进行贡献. 每次划分时,从当前位置往后扫,扫到 \(m\) 个前 \ ...

  3. BZOJ1026 SCOI2009 windy数 【数位DP】

    BZOJ1026 SCOI2009 windy数 Description windy定义了一种windy数.不含前导零且相邻两个数字之差至少为2的正整数被称为windy数. windy想知道,在A和B ...

  4. javascript基础-js对象

    一.js对象的创建 1.普通最简单的方式 var teacher = new Object( ); teacher.name = "zhangsan"; teacher.age = ...

  5. java代码------计算器核心位置添加

    总结:点击等号时,什么代码 else if(str.equals("-")){ ready=true; if(c=='\0'){ num1=Double.parseDouble(j ...

  6. 如何利用JConsole观察分析Java程序的运行并进行排错调优_java

    如何利用JConsole观察分析Java程序的运行并进行排错调优_java 官方指导  use jconsole use jmx technology

  7. UE4 代码总结

    1.创建关卡类 1.创建C++类继承LevelScriptActor 2.打开关卡蓝图 Class Settings->Parent Class 选择你之前创建好的C++类 遇到的问题: 1.T ...

  8. Linux学习笔记 - Shell 输出命令

    1. echo 命令 echo 是基本的shell输出命令,她的语法是: echo string 我们也可以使用她来定制一些输出的格式,具体如下: 输出普通字符串 echo "it is a ...

  9. python学习(二十) Python 中的比较:is 与 ==

    Python 中的比较:is 与 == 在 Python 中会用到对象之间比较,可以用 ==,也可以用 is .但是它们的区别是什么呢? is 比较的是两个实例对象是不是完全相同,它们是不是同一个对象 ...

  10. 2017百度之星初赛A-1006(HDU-6113)

    思路:在图的外面包一圈'0'字符,然后dfs统计'0'字符的个数和'1'字符的个数.结果如下(num0表示0字符的个数,num1表示1字符的个数): num0 == 1 && num1 ...