diff --git a/source/tutorial/install-mongodb-on-suse.txt b/source/tutorial/install-mongodb-on-suse.txt new file mode 100644 index 00000000000..3037dd172e7 --- /dev/null +++ b/source/tutorial/install-mongodb-on-suse.txt @@ -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`"