Install the MongoDB on Linux system

Source: Internet
Author: User
Tags install mongodb

Configure the package Management system ( yum).

Create a /etc/yum.repos.d/mongodb-org-3.2.repo file so this you can install MongoDB directly, using yum .

Changed in version 3.0:mongodb Linux packages is in a new repository beginning with 3.0.

For the LatestStable release of MongoDB

Use the following repository file:

[mongodb-org-3.2] name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/ mongodb-org/3.2/x86_64/Gpgcheck=1enabled=1gpgkey=https:// WWW.MONGODB.ORG/STATIC/PGP/SERVER-3.2.ASC            
For versions of MongoDB earlierthan 3.0

To install the packages from a earlier release series, such as 2.4 or 2.6, you can specify the release series in the Repo Sitory configuration. For example, to restrict your system to the 2.6 release series, create a file to hold the /etc/yum.repos.d/mongodb-org-2.6.repo following configuration in Formation for the MongoDB 2.6 repository:

[mongodb-org-2.6] name=MongoDB 2.6 Repositorybaseurl=http://downloads-distro.mongodb.org/repo/redhat/os/ x86_64/Gpgcheck=0Enabled=1          

You can find files for each release in the .repo repository itself. Remember that odd-numbered minor release versions (e.g. 2.5) is development versions and is unsuitable for production us E.

2Install the MongoDB packages and associated tools.

When you install the packages, you choose whether to install the current release or a previous one. This step provides the commands for both.

To install the latest stable version of MongoDB, issue the following command:

sudo yum install-y mongodb-org

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

sudo yum install-y mongodb-org-3.2.17 mongodb-org-server-3.2.17 mongodb-org-shell-3.2.17 mongodb-org-mongos-3.2.17 mongodb-org-tools-3.2.17

You can specify any available version of MongoDB. However would yum upgrade the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To pin a package, add the following exclude directive to your /etc/yum.conf file:

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

Install the MongoDB on Linux system

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.