Wednesday, February 16, 2022

Deploy MongoDB Compass And Connect To MongoDB

                           
in This Tutorial you will Learn " How To Deploy MongoDB Compass & Connect To MongoDB On Rocky Linux 8.5"

MongoDB is a free, open-source, cross-platform, document-oriented database. It is also classified as a non-SQL database program. Compass is an interactive tool for querying, optimizing & analyzing MongoDB data. It works in a visual environment. It can be installed in any operating system like Windows, Linux, Mac etc.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      | IP -192.168.1.60        |Hostname - server.yourdomain.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; dnf groupinstall "Development Tools" -y
cat > /etc/yum.repos.d/mongodb.repo << 'EOL'
[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
EOL
dnf update ; dnf install mongodb-org -y ; systemctl start mongod ; systemctl enable mongod

wget https://downloads.mongodb.com/compass/mongodb-compass-1.28.1.x86_64.rpm
yum localinstall mongodb-compass-1.28.1.x86_64.rpm
nano /etc/mongod.conf
#security
security:
  authorization: "enabled"
systemctl restart mongod ; systemctl status mongod
mongo
use admin
db.createUser(
      {
      user: "mongod_admin",
      pwd: "strongpassword",
      roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
      }
    )
firewall-cmd --permanent --add-port=27017/tcp ; firewall-cmd --reload
Root Password -
_________________________________________________________________________________________

No comments:

Post a Comment