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
1 |
vi /etc/yum.repos.d/mongodb-org-3.6.repo |
Add
1 2 3 4 5 6 |
[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
1 |
yum install mongodb-org |
Enable MongoDB start on boot with
1 |
systemctl enable MongoDB |
To start MongoDB, run
1 |
systemctl start mongod |
You can check status of MongoDB with
1 |
systemctl status mongod |