Install MongoDB Community Edition on SUSE
On this page
Overview
Use this tutorial to install MongoDB 3.6 Community Edition on SUSE Linux Enterprise Server (SLES) using the zypper
package manager.
Considerations
Platform Support
MongoDB 3.6 Community Edition supports the following 64-bit SUSE Linux Enterprise Server (SLES) release on x86_64 architecture:
- SLES 12
MongoDB only supports the 64-bit version of this platform.
See Supported Platforms for more information.
Windows Subsystem for Linux (WSL) - Unsupported
MongoDB does not support the Windows Subsystem for Linux (WSL).
Production Notes
Before deploying MongoDB in a production environment, consider the Production Notes document which offers performance considerations and configuration recommendations for production MongoDB deployments.
Install MongoDB Community Edition
Follow these steps to install MongoDB Community Edition using the zypper
package manager.
Configure the package management system (zypper
).
Add the repository so that you can install MongoDB using zypper
.
Changed in version 3.0: MongoDB Linux packages are in a new repository beginning with 3.0.
For versions of MongoDB earlier than 3.6
To install MongoDB packages from a previous release series such as 3.4, you can specify the release series in the repository configuration.
For example, to restrict your SUSE 12 system to the 3.4 release series, use the following command:
Install the MongoDB packages.
To install the latest stable version of MongoDB, issue the following command:
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:
You can specify any available version of MongoDB. However zypper
will upgrade the packages when a newer version becomes available. To prevent unintended upgrades, pin the packages by running the following command:
Previous versions of MongoDB packages use a different repository location. Refer to the version of the documentation appropriate for your MongoDB version.
Run MongoDB Community Edition
- ulimit Considerations
- Most Unix-like operating systems limit the system resources that a session may use. These limits may negatively impact MongoDB operation. See UNIX ulimit Settings for more information.
- Directories
-
By default, MongoDB instance stores:
- its data files in
/var/lib/mongo
- its log files in
/var/log/mongodb
If you installed via the package manager, these default directories are created during the installation.
If you installed manually by downloading the tarballs, you can create the directories using
mkdir -p <directory>
orsudo mkdir -p <directory>
depending on the user that will run MongoDB. (See your linux man pages for information onmkdir
andsudo
.)By default, MongoDB runs using the
mongod
user account. If you change the user that runs the MongoDB process, you must also modify the permission to the/var/lib/mongo
and/var/log/mongodb
directories to give this user access to these directories.To specify a different log file directory and data file directory, edit the
systemLog.path
andstorage.dbPath
settings in the/etc/mongod.conf
. Ensure that the user running MongoDB has access to these directories. - its data files in
Procedure
Follow these steps to run MongoDB Community Edition. These instructions assume that you are using the default settings.
Init System
To run and manage your mongod
process, you will be using your operating system’s built-in init system. Recent versions of Linux tend to use systemd (which uses the systemctl
command), while older versions of Linux tend to use System V init (which uses the service
command).
If you are unsure which init system your platform uses, run the following command:
Then select the appropriate tab below based on the result:
systemd
- select the systemd (systemctl) tab below.init
- select the System V Init (service) tab below.
- systemd (systemctl)
- System V Init (service)
Verify that MongoDB has started successfully.
You can verify that the mongod
process has started successfully by issuing the following command:
You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:
Stop MongoDB.
As needed, you can stop the mongod
process by issuing the following command:
Restart MongoDB.
You can restart the mongod
process by issuing the following command:
You can follow the state of the process for errors or important messages by watching the output in the /var/log/mongodb/mongod.log
file.
Start MongoDB.
You can start the mongod
process by issuing the following command: