Step by Step Mongodb Installation in centos7

Step 1 : Create a file where we install Mongodb

Run Command:

vi /etc/yum.repos.d/mongodb-org-4.2.repo

Step 2 : Copy This in above file

[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc

Step 3 : Install the MongoDB packages.

sudo yum install -y mongodb-org

Step 4 : To start Mongodb service

systemctl start mongod.service  or systemctl start mongodb

  

Leave a Reply

%d bloggers like this: