Skip to content

Create install-mongodb-on-suse.txt #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions source/tutorial/install-mongodb-on-suse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
==============================================================
Install MongoDB on SUSE Linux Enterprise Server
==============================================================

.. default-domain:: mongodb

Synopsis
--------

This tutorial outlines the basic installation process for deploying
:term:`MongoDB` on SUSE Linux Enterprise Server and openSUSE. This procedure uses
``.rpm`` packages as the basis of the installation. 10gen publishes
packages of the MongoDB releases as ``.rpm`` packages for easy installation and
management for users. While some of these distributions include their
own MongoDB packages, the 10gen packages are generally more up to date.

This tutorial includes: an overview of the available packages,
instructions for configuring the package manager, the install process,
and preliminary MongoDB configuration and operation.

.. see:: Additional installation tutorials:

- :doc:`/tutorial/install-mongodb-on-debian-or-ubuntu-linux`
- :doc:`/tutorial/install-mongodb-on-debian`
- :doc:`/tutorial/install-mongodb-on-ubuntu`
- :doc:`/tutorial/install-mongodb-on-linux`
- :doc:`/tutorial/install-mongodb-on-os-x`
- :doc:`/tutorial/install-mongodb-on-windows`
- :doc:`/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux`

.. Documentation for getting started with MongoDB:

.. - :doc:`/getting-started`
.. STUB - :doc:`/tutorial/insert-test-data-into-a-mongodb-database`

Package Availability
--------------------

Packages are available for different version of SUSE Linux Enterprise Server
and openSUSE, please refer to

.. code-block:: cfg

http://software.opensuse.org/package/mongodb



Install MongoDB
---------------

Configure Package Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Create a repository for the installation method. If you are running a
64-bit system (recommended,) execute:
.. code-block:: cfg

zypper ar http://download.opensuse.org/repositories/server:/database/SLE_11_SP3/x86_64/ mongodb


If you are running a 32-bit system, which isn't recommended for
production deployments, place the following configuration in
``/etc/yum.repos.d/10gen.repo`` file:

.. code-block:: cfg

zypper ar http://download.opensuse.org/repositories/server:/database/SLE_11_SP3/i586/ mongodb


Install Packages
~~~~~~~~~~~~~~~~

Issue the following command (as ``root`` or with ``sudo``) to install
the latest stable version of MongoDB and the associated tools:

.. code-block:: sh

zypper in mongodb

When this command completes, you have successfully installed MongoDB!

Configure MongoDB
-----------------

These packages configure MongoDB using the ``/etc/mongod.conf`` file
in conjunction with the :term:`control script`. You can find the init
script at ``/etc/rc.d/init.d/mongodb``.

This MongoDB instance will store its data files in the
``/var/lib/mongodb`` and its log files in ``/var/log/mongodb``, and
run using the ``mongodb`` user account.

.. note::

If you change the user that runs the MongoDB process, you will need
to modify the access control rights to the ``/var/lib/mongodb`` and
``/var/log/mongodb`` directories.


Start MongoDB
~~~~~~~~~~~~~

Start the :program:`mongod` process by issuing the following command
(as root, or with ``sudo``):

.. code-block:: sh

service mongodb start

You can verify that the :program:`mongod` process has started
successfully by checking the contents of the log file at
``/var/log/mongodb/mongod.log``.

You may optionally, ensure that MongoDB will start following a system
reboot, by issuing the following command (with root privileges:)

.. code-block:: sh

chkconfig mongodb on

Stop MongoDB
~~~~~~~~~~~~

Stop the :program:`mongod` process by issuing the following command
(as root, or with ``sudo``):

.. code-block:: sh

service mongodb stop

Restart MongoDB
~~~~~~~~~~~~~~~

You can restart the :program:`mongod` process by issuing the following
command (as root, or with ``sudo``):

.. code-block:: sh

service mongodb restart

Follow the state of this process by watching the output in the
``/var/log/mongodb/mongod.log`` file to watch for errors or important
messages from the server.


Using MongoDB
-------------

Included in the package, is the :program:`mongo` shell. You can connect
to your MongoDB instance byissuing the following command at the system prompt:

.. code-block:: sh

mongo

This will connect to the database running on the localhost interface
by default. At the :program:`mongo` prompt, issue the following two
commands to insert a record in the "test" :term:`collection` of the
(default) "test" database and then retrieve that document.

.. code-block:: javascript

db.test.save( { a: 1 } )
db.test.find()

.. seealso:: ":program:`mongo`" and ":doc:`/reference/method`"