Install MongoDB on CentOS 7

To find latest MongoDB version, see

https://docs.mongodb.com/manual/release-notes/

To install MongoDB 3.6 on CentOS 7, create file

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

Add

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

Refer https://docs.mongodb.com/master/tutorial/install-mongodb-on-red-hat/

Now install MongoDB with

yum install mongodb-org

Enable MongoDB start on boot with

systemctl enable MongoDB

To start MongoDB, run

systemctl start mongod

You can check status of MongoDB with

systemctl status mongod

MongoDB

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *