How to Install MongoDB 6.0 on SuSE 15 | MongoDB-org

  Install MongoDB v6.0 Community Edition on SuSE 15

 

Overview

Use this tutorial to install MongoDB 6.0 Community Edition on SUSE Linux Enterprise Server (SLES) using the zypper package manager.


Platform Support

MongoDB 6.0 Community Edition supports the following 64-bit SUSE Linux Enterprise Server (SLES) releases on x86_64 architecture:

    SLES 15
    SLES 12

MongoDB only supports the 64-bit versions of these platforms.


Install MongoDB Community Edition

Follow these steps to install MongoDB Community Edition using the zypper package manager.

1. Import the MongoDB public key.

# sudo rpm --import https://www.mongodb.org/static/pgp/server-6.0.asc


2. Add the MongoDB repository.

Add the repository so that you can install MongoDB. Use the command appropriate for your version of SUSE:

SUSE 15:

# sudo zypper addrepo --gpgcheck "https://repo.mongodb.org/zypper/suse/15/mongodb-org/6.0/x86_64/" mongodb

SUSE 12:

# sudo zypper addrepo --gpgcheck "https://repo.mongodb.org/zypper/suse/12/mongodb-org/6.0/x86_64/" mongodb


3. Install the MongoDB packages.

To install the latest version of MongoDB, issue the following command:

# sudo zypper -n install mongodb-org

To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:

# sudo zypper install mongodb-org-6.0.1 mongodb-org-database-6.0.1 mongodb-org-server-6.0.1 mongodb-mongosh-6.0.1 mongodb-org-mongos-6.0.1 mongodb-org-tools-6.0.1


4. Run MongoDB Community Edition

1. Start MongoDB.

# sudo systemctl start mongod

If you receive an error similar to the following when starting mongod:

Failed to start mongod.service: Unit mongod.service not found.

Run the following command first:

# sudo systemctl daemon-reload

Then run the start command above again.


2. Verify that MongoDB has started successfully.

You can verify that the mongod process has started successfully by issuing the following command:

# sudo systemctl status mongod

You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:

# sudo systemctl enable mongod


5. Begin using MongoDB.

Start a mongosh session on the same host machine as the mongod. You can run mongosh without any command-line options to connect to a mongod that is running on your localhost with default port 27017.

# mongosh


Uninstall MongoDB Community Edition

To completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.

1. Stop MongoDB.


Stop the mongod process by issuing the following command:

# sudo service mongod stop


2. Remove Packages.

Remove any MongoDB packages that you had previously installed.

# sudo zypper remove $(rpm -qa | grep mongodb-org)


3. Remove Data Directories.

Remove MongoDB databases and log files.

# sudo rm -r /var/log/mongodb
# sudo rm -r /var/lib/mongo



Additional Information
Localhost Binding by Default:

By default, MongoDB launches with bindIp set to 127.0.0.1, which binds to the localhost network interface. This means that the mongod can only accept connections from clients that are running on the same machine. Remote clients will not be able to connect to the mongod, and the mongod will not be able to initialize a replica set unless this value is set to a valid network interface.

Lastly, I hope it's helpful. So, let me know your suggestions and feedback using the comment section.
 



Comments

Post a Comment

Contact Form

Name

Email *

Message *

Popular posts from this blog

Red Hat Certified Systems Administrator – RHCSA (EX200) Ex@m practice 2022

Step-by-Step Install and Configure OpenLDAP on RHEL7/CentOS 7 Linux

Creating RAID-0 (Stripe) in Linux