Install MongoDB in Redhat Linux with 5 Easy Steps:

Install MongoDB in Redhat Linux with 5 Easy Steps:

It is very easy to install MongoDB in Redhat Linux. Today we will do the MongoDB installation in Redhat Linux with detailed steps through yum utility.

Installation of MongoDB in Redhat Linux :

Pre Requisites :

Here we are installing MongoDB through the yum utility, so as a pre-requisite, the server needs to connect to the internet. You can check as below :

Install MongoDB in Redhat Linux with 5 Easy Steps:

Steps to Install MongoDB :

Step 1: Create a /etc/yum.repos.d/mongodb-enterprise-4.4.repo file as below :

[root@mongo ~]# cat /etc/yum.repos.d/mongodb-enterprise-4.4.repo
[mongodb-enterprise-4.4]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/4.4/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc

Step 2: Install MongoDB enterprise using yum utility

Issue the below command to install the MongoDB Enterprise packages :

yum install -y mongodb-enterprise

With that command, the below packages will be installed.

  • mongodb-enterprise-cryptd
  • mongodb-enterprise-tools
  • mongodb-enterprise-mongos
  • mongodb-enterprise-shell
  • mongodb-enterprise-server

Step 3: Start MongoDB process :

[root@mongo ~]#  systemctl start mongod

We can configure also enabling the automatic starting of MongoDB. But this is optional, For this, Stop the MongoDB process :

systemctl stop mongod

Enable automatic starting of mongoDB :

systemctl enable mongod

Step 4: Check the status of MongoDB :

systemctl status mongod
install mongodb

So, the status should be active and running.

Step 5: Connect to MongoDB

From the OS prompt, issue the Mongo command :

Install MongoDB in Redhat Linux with 5 Easy Steps:

So, here are the simple and easy detailed steps by which you can install MongoDB in your Redhat Linux Server. Hope you liked it.

Also, you can follow the MongoDB Official Doc for further reference.

This Post Has 2 Comments

Leave a Reply