Problem scenario
You want to install MongoDB on a RHEL server. What do you do?
Solution
1. Create this file: /etc/yum.repos.d/mongodb-org-4.4.repo
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
- Run these commands:
sudo yum -y update
sudo yum -y install mongodb-org
- Test the installation by running this:
mongod -version
If you are using Debian or Ubuntu, see this posting.