How to Install MongoDB on CentOS/RHEL 7
MongoDB (named from “
MongoDB has released a new stable version 4.2 with lots of major enhancements. This tutorial is the latest test on CentOS 7 and helps you to install MongoDB 4.2 on CentOS 8/7/6 and RHEL 8/7/6 systems.
Step 1 – Add MongoDB Yum Repository
Add the following content in the yum repository configuration file mongodb.repo as per your required MongoDB version and system architecture. For this article, we are using MongoDB 4.0 repository.
CentOS and RedHat systems Only
Step 2 – Install MongoDB Server
Let’s use the yum package manager to install mongodb-org package, it will automatically install all its dependencies. To install any specific revision of MongoDB specify package name with a version like mongodb-org-4.0.0. The following command will install the latest stable version available.
Step 3 – Start MongoDB Service
Package mongodb-org-server provided MongoDB init script, Use that script to start service.
Configure MongoDB to autostart on system boot.
Step 4 – Check MongoDB Version
Use the following command to check the installed MongoDB version
Connect MongoDB using the command line and execute some test commands for checking proper working.
References:
http://docs.mongodb.org/manual/installation/
0 Comments
CAN FEEDBACK
Emoji