Installing MongoDB in CentOS 7
Adding MongoDB repositories to yum
Following the steps specified in the [MongoDB installation guide][], we need to add mongo to the yum repository adding to /etc/yum.repos.d/mongodb.repo
the following:
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
As super user this file can be created using the command showed below:
Installing MongoDB with yum
Once the file have been created we can install MongoDB using yum:
Configuring MongoDB
By default, MongoDB configuration is stored in /etc/mongodb.conf
there is not need to change anything to make it work. In the case external connections are required, the value bind_ip=127.0.0.1
must be commented out. This can be done using:
By default MongoDB is runining on the port 21017, so as part of allowing external access, this port must be opened in the firewall.