- Install MongoDB >
- Install on Linux >
- Install MongoDB on Red Hat Enterprise or CentOS Linux
Install MongoDB on Red Hat Enterprise or CentOS Linux¶
Note
The downloads-distro.mongodb.org
host has been decommissioned.
To get the binaries for MongoDB 2.6 (which has reached end of life
on October 2016):
- For the Community Edition, you can download from https://www.mongodb.org/dl/linux/x86_64.
- For the Enterprise Edition, you can download from https://www.mongodb.com/download-center/enterprise/releases/archive.
Once downloaded, you can follow the instructions on Install MongoDB on Linux Systems.
Considerations¶
For production deployments, always run MongoDB on 64-bit systems.
Configure SELinux¶
Important
You must configure SELinux to allow MongoDB to start on Red Hat Linux-based systems (Red Hat Enterprise Linux or CentOS Linux).
To configure SELinux, administrators have three options:
Note
All three options require root
privileges. The first two options
each requires a system reboot and may have larger implications for
your deployment.
Disable SELinux entirely by changing the
SELINUX
setting todisabled
in/etc/selinux/config
.Set SELinux to
permissive
mode in/etc/selinux/config
by changing theSELINUX
setting topermissive
.Note
You can use
setenforce
to change to permissive mode; this method does not require a reboot but is not persistent.Enable access to the relevant ports (e.g. 27017) for SELinux if in
enforcing
mode. See Default MongoDB Port for more information on MongoDB’s default ports. For default settings, this can be accomplished by runningWarning
On RHEL 7.0, if you change the data path, the default SELinux policies will prevent
mongod
from having write access on the new data path if you do not change the security context.
You may alternatively choose not to install the SELinux packages when you are installing your Linux operating system, or choose to remove the relevant packages. This option is the most invasive and is not recommended.