Installing MongoDB under CentOS

Source: Internet
Author: User
Tags install mongodb

This document describes how to install MongoDB under CentOS 6 or 7 x64.

1. Configuration package Management System (YUM)

Take the MongoDB 3.6 version as an example

Create a/etc/yum.repos.d/mongodb-org-3.6.repo file to install MongoDB directly using Yum;

The Enterprise Edition is/etc/yum.repos.d/mongodb-enterprise.repo.

The contents of the file are as follows:

A. Community version
[mongodb-org-3.6== https://11= HTTPS://  WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.6.ASC

B. Enterprise version
[mongodb-== https://11= https://  WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.6.ASC

If you need other versions to find other versions on the MongoDB website, modify the version number of the repo file, where the odd version is the development version and is not recommended for production use.

2. Installing MongoDB
sudo Yum Install -y mongodb-org

To install a specific version of MongoDB, specify each component package separately and append the version number to the package name, as shown in the following example:

sudo Yum Install -y mongodb-org-3.6. 2 mongodb-org-server-3.6. 2 mongodb-org-shell-3.6. 2 mongodb-org-mongos-3.6. 2 mongodb-org-tools-3.6. 2

If a version is specified, in order to prevent accidental escalation, you can add the following information in/etc/yum.conf:

Exclude = Mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

MongoDB Start command

sudo service mongod start

MongoDB End Command

sudo service mongod stop

MongoDB Restart command

sudo service mongod restart

Reference Documentation:

Official Document: https://docs.mongodb.com/master/tutorial/install-mongodb-on-red-hat/

Installing MongoDB under CentOS

Related Article

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.