Install MongoDB 3.2 on CentOS.

Source: Internet
Author: User
Tags install mongodb mongodb server mongodb version yum install mongodb

Install MongoDB 3.2 on CentOS.

MongoDB (named from "huMONGOus") is a database with comprehensive and flexible indexing support and rich queries. MongoDB provides powerful media storage through GridFS. Click here for more information about MongoDB.

MongoDB released a new stable version 3.2, which has been greatly improved. This tutorial will help you install MongoDB 3.2.X on CentOS, RHEL, and Fedora systems.

Step 1: Add MongoDB to the yum Repository

Add the following content to the configuration file/etc/yum. repos. d/MongoDB. repo of the yum repository according to the mongodb version and system architecture you need. In this article, we use the MongoDB 3.2 repository.

64-bit system usage:

[MongoDB]name=MongoDB Repositorybaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/gpgcheck=0enabled=1
Step 2-install the MongoDB Server

Use the yum Package Manager to install the mongodb-org package. This operation will automatically install all dependencies. To install a specific MongoDB revision, specify the package name with the version number, such as the mongodb-org-3.2.0. The following command installs the latest available stable version.

# yum install mongodb-org
Step 3-start MongoDB

The mongodb-org-server package provides the MongoDB initialization script and uses scripts to start the service.

# /etc/init.d/mongod restart

Configure MongoDB to start with the System

# chkconfig mongod on
Step 4 -- check the MongoDB version

Run the following command to check the MongoDB version:

[root@tecadmin ~]#  mongod --versiondb version v3.2.0git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013allocator: tcmallocmodules: nonebuild environment:    distmod: rhel70    distarch: x86_64    target_arch: x86_64

Connect to MongoDB and execute several test commands to check whether it works properly

[root@tecadmin ~]#  mongo> use mydb;> db.test.save( { a: 1 } )> db.test.find()  { "_id" : ObjectId("54fc2a4c71b56443ced99ba2"), "a" : 1 }

Congratulations, you have successfully installed the MongoDB server on your system. You can also practice MongoDB browser shell here.

Refer:

Http://docs.mongodb.org/manual/installation/

Original article address

How to Install MongoDB 3.2 on CentOS/RHEL & Fedora

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.