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. Android中的sp和wp指针

    经常会在android的framework代码中发现sp<xxx>和wp<xxx>这样的指针,平时看的时候都把他当成一个普通的指针封装过掉了,这几天终于忍不住了,想深入了解一下 ...

  2. 程序设计入门-C语言基础知识-翁恺-期中测试

    一.试题 程序设计入门—C 语言期中测评 试题下载地址: http://nos.netease.com/edu-lesson-pdfsrc/217E194E46A6595A3F554380337490 ...

  3. 【测试工具】tcpdump + wireshark 抓包实践

    Tcpdump + Wireshark 抓包实践 工具介绍 Tcpdump 看到dump大家应该有所意识吧,就是下载数据,抓数据.tcpdump是linux下的一个抓取tcp包的命令 Usage: t ...

  4. matlab图像处理注意溢出!先要im2double!

    imagedata_comb=imagedata_ebic*addnumber_ebic+imagedata_sem*addnumber_sem; %注意溢出啊!!!uint8最大值是255,也就是说 ...

  5. python笔记-12 redis缓存

    一.redis引入 1.简要概括redis 1.1 redis默认端口:6379 1.2 redis实现的效果:资源共享 1.3 redis实现的基本原理:不同的进程和一个公共的进程之间建立socke ...

  6. Appium 定位方法例子(4)

    有朋友留言反应定位不到元素,没错,船长也为这个一直在头疼,我用的App是原生安卓+webService+h5类型的,定位虽然没问题,但是在进行操作的时候各种不通过……真的很头疼啊……我这里说的“操作” ...

  7. Ambari HDP集群搭建文档

    一.配置主机和节点机器之间SSH无密登录 多台外网服务器配置时,需要在/etc/hosts中把本机的IP地址设置为内网IP地址 http://2d67df38.wiz02.com/share/s/0J ...

  8. Python中实现远程调用(RPC、RMI)简单例子

    说白了,远程调用就是将对象名.函数名.参数等传递给远程服务器,服务器将处理结果返回给客户端   远程调用使得调用远程服务器的对象.方法的方式就和调用本地对象.方法的方式差不多,因为我们通过网络编程把这 ...

  9. 洛谷1527(bzoj2738)矩阵乘法——二维树状数组+整体二分

    题目:https://www.luogu.org/problemnew/show/P1527 不难想到(?)可以用二维树状数组.但维护什么?怎么查询是难点. 因为求第k小,可以考虑记权值树状数组,把比 ...

  10. Linux 文件名中包含特殊字符

    文件和文件夹的名称中有特殊字符,操作有两种方式( - 在文件名称最前面除外). 例如:文件名为 a&b.c 1.通过转移符 "\" $ touch   a\&b.c ...