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. Java面试题收集以及参考答案(100道)

    不积跬步无以至千里,这里会不断收集和更新Java基础相关的面试题,目前已收集100题. 1.什么是B/S架构?什么是C/S架构 B/S(Browser/Server),浏览器/服务器程序 C/S(Cl ...

  2. NHibernate 01 [简述]

    本节内容: 系列简述 NHibernate是什么? NHibernate好处? 1.系列简述 最近在项目中使用到NHibernate,所以记录下自己学习的内容和步骤. 2.NHibernate是什么? ...

  3. 【导航】JennyHui没有宏大的计划,只有坚持!坚持!

    学英语 口语  Bingo口语笔记 听力 VOA 词汇 生词积累 座右铭 随手记 TED X - > 笔记 JennyHui要成为程序猿(加油!!菜鸟终会成为大牛的!!) 后端知识 Python ...

  4. 每天一个linux命令(权限):【转载】chmod命令

    chmod命令用于改变linux系统文件或目录的访问权限.用它控制文件或目录的访问权限.该命令有两种用法.一种是包含字母和操作符表达式的文字设定法:另一种是包含数字的数字设定法. Linux系统中的每 ...

  5. 《DSP using MATLAB》示例Example 8.13

    %% ------------------------------------------------------------------------ %% Output Info about thi ...

  6. CentOS编译安装php7.2

    介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具体性能有多好,建议还是先尝试下再说.如果你是升级或新安装,那你首先需要考虑php7和程序是否存在兼容性,如果程序是基于php ...

  7. Tornado之自定义异步非阻塞的服务器和客户端

    一.自定义的异步非阻塞的客户端 #!/usr/bin/env python # -*- coding: utf8 -*- # __Author: "Skiler Hao" # da ...

  8. docker could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

    原因: 无法进行网络分配了 解决方法: // 所有的网络 docker network ls // 删除不用的,腾出多余的 docker network rm <networkname> ...

  9. grpc 安装以及墙的解决方法

    1. 默认官方文档 go get -u google.golang.org/grpc 因墙的问题,大部分安装是无法完成的 2. 解决方法 a. grpc mkdir -p $GOAPTH/src/go ...

  10. asciidoctor 安装试用

    备注:    asciidoctor 是asciidoc 的增强,使用简单,模板比较丰富,对于持续集成方面的开发也是一个不错的工具   1. 安装 a. 环境准备 MRI Ruby 1.8.7, 1. ...