Install MongoDB Enterprise on Red Hat Enterprise or CentOS¶
Use this tutorial to install MongoDB Enterprise on Red Hat Enterprise Linux or CentOS Linux. The tutorial uses .rpm packages to install.
MongoDB provides packages of the officially supported MongoDB Enterprise builds in it’s own repository. This repository provides the MongoDB Enterprise distribution in the following packages:
This package is a metapackage that will automatically install the four component packages listed below.
This package contains the mongod daemon and associated configuration and init scripts.
This package contains the mongos daemon.
This package contains the mongo shell.
The mongodb-enterprise package includes various control scripts, including the init script /etc/rc.d/init.d/mongod.
The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts.
Install MongoDB Enterprise¶
When you install the packages for MongoDB Enterprise, you choose whether to install the current release or a previous one. This procedure describes how to do both.
Create an /etc/yum.repos.d/mongodb-enterprise.repo file so that you can install MongoDB enterprise directly, using yum.
Use the following repository file to specify the latest stable release of MongoDB enterprise.
[mongodb-enterprise] name=MongoDB Enterprise Repository baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/ gpgcheck=0 enabled=1
Use the following repository to install only versions of MongoDB for the 2.6 release. If you’d like to install MongoDB Enterprise packages from a particular release series, such as 2.4 or 2.6, you can specify the release series in the repository configuration. For example, to restrict your system to the 2.6 release series, create a /etc/yum.repos.d/mongodb-enterprise-2.6.repo file to hold the following configuration information for the MongoDB Enterprise 2.6 repository:
[mongodb-enterprise-2.6] name=MongoDB Enterprise 2.6 Repository baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/2.6/$basearch/ gpgcheck=0 enabled=1
Install the MongoDB Enterprise packages and associated tools.¶
You can install either the latest stable version of MongoDB Enterprise or a specific version of MongoDB Enterprise.
Install the latest stable version of MongoDB Enterprise.¶
Issue the following command:
sudo yum install mongodb-enterprise
Optional. Manage Installed Version¶
Install a specific release of MongoDB Enterprise.¶
Specify each component package individually and append the version number to the package name, as in the following example that installs the 2.6.1 release of MongoDB:
sudo yum install mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-2.6.1 mongodb-enterprise-mongos-2.6.1 mongodb-enterprise-tools-2.6.1
Pin a specific version of MongoDB Enterprise.¶
Although you can specify any available version of MongoDB Enterprise, yum will 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:
Previous versions of MongoDB packages use different naming conventions. See the 2.4 version of documentation for more information.
When the install completes, you can run MongoDB.¶
Run MongoDB Enterprise¶
Verify that MongoDB has started successfully¶
You can verify that the mongod process has started successfully by checking the contents of the log file at /var/log/mongodb/mongod.log.
You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:
sudo chkconfig mongod on