You can find a config named, bind_ip , Allow required IP address here as shown below. Open the configuration file, sudo vi /etc/nf
To allow the remote connections from anywhere or for the particular IP address, We need to allow the IP address in the /etc/nf configuration file. To allow remote access from anywhere, sudo ufw allow 27107 To accept connections from the remote servers, We need to configure mongoDB and allow port 27017 port on the firewall. To disable mongoDB service on system startup, sudo systemctl disable mongodb Configuring Remote Accessīy default, MongoDB will accept connections only from localhost and listens on the port 27017. To restart the mongoDB service, sudo systemctl restart mongodb To stop the mongoDB service, sudo systemctl stop mongodb To automatically start the mongodb service on system reboot, systemctl enable mongodīy default, MongoDB process listens on the port 27017.To check, sudo netstat -nltp |grep mongo To check the status of the mongoDB service, systemctl status mongod Using the below command, Start the MongoDB service. The mongoDB service file rvice is created under /usr/lib/systemd/system folder. The systemd service file will be created by default while installing MongoDB, Using which we can easily manage the mongodb service. To check the version of MongoDB installed on the system, use the below command. While installing MongoDB using the above command, The following dependencies such as mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools will also be installed on the system. Now we can install mongodb from the repository we have added using yum command. cd /etc// vi mongodb.repoĪnd paste the below contents to the file. Installing MongoDB on Centos 7īefore proceeding further, Make sure you have root or sudo privileges to perform mongoDB installation on the server.įollow the below steps to install MongoDB community Edition using yum package manager.įirst we need to configure yum for mongodb.Ĭreate a file named mongodb.repo under /etc/ folder. The data objects are stored as separate documents inside a collection - instead of storing the data into the columns and rows of a traditional relational database. It is based on the NoSQL document store model. MongoDB is an object-oriented, simple, dynamic, and scalable NoSQL database. In this blog post, We will learn how to Install MongoDB on Centos 7.Īlso explained how to manage MongoDB and configure remote access.