MongoDB – Installation:

Note: MongoDB 3.2 deprecates the support for RHEL 5.

MongoDB Installation:

This installation guide will be useful for installing MongoDB on Linux (RHEL). Once after the Linux host is ready with an internet connection, below is the process of installation.

1. Create a Linux user called mongo ( as you wish ) . if you wish to install in root , then mongo user is not mandatory

2. Create and configure /etc/yum.repos.d/mongodb-org-3.4.repo file to do the installation using Yum utility.

3. Please copy and paste the below lines in the repository file.

4. Once the repository file is ready, give the below command in the terminal.

By giving the above command, request through the repository file would reach to MongoDB server to get all the required packages of latest stable version of MongoDB.

By default, the port 27017 should be available , if not then enable the default port 27017 which is used by MongoDB using the below command.

Start the Mongo DB:

Check if the mongo database is already running 

1. ps -ef | grep mongod
2. sudo service mongod status

Mongo DB file locations 

Error log file location: /var/log/mongodb/mongod.log
Configuration location: /etc/mongod.conf
Database file location: /var/lib/mongo
Log files location: /var/log/mongodb

Verify the running status of mongo DB 

Check if the mongo database is already running

1. ps -ef | grep mongod
2. sudo service mongod status