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. PHP convet class to json data

    /********************************************************************* * PHP convet class to json da ...

  2. js工具类的封装

    common.js原生js实现的大多工具方法都将放在common文件中 布局rem.js,vue开发时,我们只需要将rem.js再main.js中import 引入即可 (function(win, ...

  3. java project 项目在 linux 下面部署方法

    1.前提是安装好了响应的开发和部署环境,例如jdk. 2.在Linux下运行可执行Jar包,首先准备jar包,一般的编译工具Eclipse,jbuilder都提供export功能,可以生成jar包. ...

  4. POJ1201 Intervals【差分约束系统】

    Description You are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn. Write a p ...

  5. Codeforces 1030F 【线段树】【好题】

    LINK 题目大意: 给你n个物品,每一个物品有一个位置p和一个权值w,移动一个物品的代价是移动距离*物品权值 有q个询问: 把第i个物品的权值变成j 问把第l到第r个物品移动到一个相邻的区间中\([ ...

  6. Codeforces 1012C Hills【DP】*

    Codeforces 1012C Hills Welcome to Innopolis city. Throughout the whole year, Innopolis citizens suff ...

  7. Win32 程序在启动时激活前一个启动程序的窗口

    UWP 程序天生单实例.当然,新 API (10.0.17134)开始也提供了多实例功能.不过,传统 Win32 程序可就要自己来控制单实例了. 本文介绍简单的几个 Win32 方法调用,使 Win3 ...

  8. 一个查看Cookie的便捷工具——EditThisCookie

    Appium正在努力准备中,很快就要和大家见面了- 今天给大家分享一个查看cookies的工具,用fiddler总感觉有点麻烦,还乱七八糟的找不到到底哪个链接是当前网站的cookies: 首先,你用的 ...

  9. ASP.NET导入导出Excel方法大全

    本文介绍下,C#实现的可以导出与导入excel的代码一例,有需要的朋友,参考下吧. C#实现导出与导入excel.代码1: 复制代码 代码示例:#region  导出Excel  /// <su ...

  10. (高级篇)jQuery学习之jQuery Ajax用法详解

    jQuery Ajax在web应用开发中很常用,它主要包括有ajax,get,post,load,getscript等等这几种常用无刷新操作方法,下面我来给各位同学介绍介绍. 我们先从最简单的方法看起 ...