Navigation
This version of the documentation is archived and no longer supported.

Install MongoDB Enterprise on SUSE

Overview

Use this tutorial to install MongoDB Enterprise on SUSE Linux. MongoDB Enterprise is available on select platforms and contains support for several features related to security and monitoring.

Packages

MongoDB provides packages of the officially supported MongoDB Enterprise builds in it’s own repository. This repository provides the MongoDB Enterprise distribution in the following packages:

Control Scripts

The mongodb-enterprise package includes various control scripts, including the init script /etc/rc.d/init.d/mongod.

The package configures MongoDB using the /etc/mongod.conf file in conjunction with the control scripts. See the Configuration File reference for documentation of settings available in the configuration file.

As of version 2.6.12, there are no control scripts for mongos. The mongos process is used only in sharding. You can use the mongod init script to derive your own mongos control script.

Prerequisites

MongoDB only provides Enterprise packages for 64-bit builds of SUSE Enterprise Linux version 11.

Use the provided distribution packages as described in this page if possible. These packages will automatically install all of MongoDB’s dependencies, and are the recommended installation method.

Install MongoDB Enterprise

1

Configure the package management system (zypper).

Add the repository so that you can install MongoDB using zypper.

Use the following command to specify the MongoDB 2.6 branch:

sudo zypper addrepo --no-gpgcheck https://repo.mongodb.com/zypper/suse/11/mongodb-enterprise/2.6/x86_64/ mongodb
2

Install the MongoDB packages and associated tools.

To install the latest release of MongoDB 2.6, issue the following command:

sudo zypper install mongodb-enterprise

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-enterprise-2.6.10 mongodb-enterprise-server-2.6.10 mongodb-enterprise-shell-2.6.10 mongodb-enterprise-mongos-2.6.10 mongodb-enterprise-tools-2.6.10

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:

sudo zypper addlock mongodb-enterprise-2.6.10 mongodb-enterprise-server-2.6.10 mongodb-enterprise-shell-2.6.10 mongodb-enterprise-mongos-2.6.10 mongodb-enterprise-tools-2.6.10

Install MongoDB Enterprise From Tarball

Note

The Enterprise tarball includes an example SNMP configuration file named mongod.conf. This file is not a MongoDB configuration file.

1

Install dependencies

sudo zypper install cyrus-sasl krb5 libgcc46 libopenssl0_9_8 libsnmp15 libstdc++46 zlib
2

Download and install the MongoDB Enterprise packages.

After you have installed the required prerequisite packages, download and install the MongoDB Enterprise packages from http://mongodb.com/download/. The MongoDB binaries are located in the bin/ directory of the archive. To download and install, use the following sequence of commands.

curl -O http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-suse11-2.6.12.tgz
tar -zxvf mongodb-linux-x86_64-enterprise-suse11-2.6.12.tgz
cp -R -n mongodb-linux-x86_64-enterprise-suse11-2.6.12/ mongodb
3

Install the MongoDB packages and associated tools.

Once you have copied the MongoDB binaries to their target location, ensure that the location is included in your PATH variable. If it is not, either include it or create symbolic links from the binaries to a directory that is included.

Run MongoDB Enterprise

The MongoDB instance stores its data files in /var/lib/mongo and its log files in /var/log/mongodb by default, and runs using the mongod user account. You can specify alternate log and data file directories in /etc/mongod.conf. See systemLog.path and storage.dbPath for additional information.

If you change the user that runs the MongoDB process, you must modify the access control rights to the /var/lib/mongo and /var/log/mongodb directories to give this user access to these directories.

1

Start MongoDB.

You can start the mongod process by issuing the following command:

sudo service mongod start
2

Verify that MongoDB has started successfully

You can verify that the mongod process has started successfully by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading

[initandlisten] waiting for connections on port <port>

where <port> is the port configured in /etc/mongod.conf, 27017 by default.

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

sudo chkconfig mongod on
3

Stop MongoDB.

As needed, you can stop the mongod process by issuing the following command:

sudo service mongod stop
4

Restart MongoDB.

You can restart the mongod process by issuing the following command:

sudo service mongod restart

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.

5

Begin using MongoDB.

To begin using MongoDB, see Getting Started with MongoDB. Also consider the Production Notes document before deploying MongoDB in a production environment.

Later, to stop MongoDB, press Control+C in the terminal where the mongod instance is running.

Uninstall MongoDB

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.

Warning

This process will completely remove MongoDB, its configuration, and all databases. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.

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-enterprise)
3

Remove Data Directories.

Remove MongoDB databases and log files.

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