MongoDB is an open-source cross-platform document-oriented database, classified as a NoSQL database program.
We can install MongoDB on a Centos7 using yum, but we need to add the MongoDB repository. You can watch the video tutorial by clicking here.
1. Create a repo file inside '/etc/yum.repos.d/' directory.
# vi /etc/yum.repos.d/mongodb-org.repo
Paste the following contents to the repo file:
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
2. Update the repo list using the following command:
# yum repolist
3. Install MongoDB:
# yum install mongodb-org
4. Start the Service:
# systemctl start mongod