diff --git a/source/includes/fact-directories-debian.rst b/source/includes/fact-directories-debian.rst new file mode 100644 index 00000000000..dd44b8ec1a5 --- /dev/null +++ b/source/includes/fact-directories-debian.rst @@ -0,0 +1,17 @@ +The MongoDB instance stores its data files in ``/var/lib/mongodb`` +and its log files in ``/var/log/mongodb`` by default, +and runs using the ``mongodb`` +user account. You can specify alternate log and data file +directories in ``/etc/mongodb.conf``; see +:doc:`/reference/configuration-options` for details. + +If you change the user that runs the MongoDB process, you +**must** modify the access control rights to the ``/var/lib/mongodb`` and +``/var/log/mongodb`` directories, e.g. by running + +.. code-block:: sh + + chown -R /var/lib/mongodb + chown -R /var/log/mongodb + +as a user with appropriate privileges. diff --git a/source/includes/fact-directories-redhat.rst b/source/includes/fact-directories-redhat.rst new file mode 100644 index 00000000000..1d7985dac77 --- /dev/null +++ b/source/includes/fact-directories-redhat.rst @@ -0,0 +1,17 @@ +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/mongodb.conf``; see +:doc:`/reference/configuration-options` for details. + +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, e.g. by running + +.. code-block:: sh + + chown -R /var/lib/mongo + chown -R /var/log/mongodb + +as a user with appropriate privileges. diff --git a/source/includes/fact-installation-bind-ip-default-in-config.rst b/source/includes/fact-installation-bind-ip-default-in-config.rst index f9441f39227..5cb76e2d6f0 100644 --- a/source/includes/fact-installation-bind-ip-default-in-config.rst +++ b/source/includes/fact-installation-bind-ip-default-in-config.rst @@ -1,4 +1,4 @@ The default ``/etc/mongodb.conf`` configuration file supplied by the -2.6 series ``.deb`` package has :setting:`~net.bind_ip`` set to +2.6 series packages has :setting:`~net.bind_ip`` set to ``127.0.0.1`` by default. Modify this setting as needed for your environment before initializing a :term:`replica set`. diff --git a/source/includes/fact-selinux-redhat-options.rst b/source/includes/fact-selinux-redhat-options.rst new file mode 100644 index 00000000000..9a61b8e8780 --- /dev/null +++ b/source/includes/fact-selinux-redhat-options.rst @@ -0,0 +1,36 @@ +You must configure SELinux to allow MongoDB to start on Red Hat Linux-based +systems (Red Hat Enterprise Linux, CentOS, Fedora). Administrators have three +options: + +- enable access to the relevant ports (e.g. 27017) for SELinux. See + :doc:`/reference/default-mongodb-port` for more information on MongoDB's + default ports. For default settings, this can be accomplished by running + + .. code-block:: sh + + semanage port -a -t mongodb_port_t -p tcp 27017 + +- set SELinux to ``permissive`` mode in ``/etc/selinux.conf``. The line + + .. code-block:: sh + + SELINUX=enforcing + + should be changed to + + .. code-block:: sh + + SELINUX=permissive + +- disable SELinux entirely; as above but set + + .. code-block:: sh + + SELINUX=disabled + +All three options require ``root`` privileges. The latter two options each +requires a system reboot and may have larger implications for your deployment. + +You may alternatively choose not to install the SELinux packages when you are +installing your Linux operating system, or choose to remove the relevant +packages. This option is the most invasive and is not recommended. diff --git a/source/includes/list-mongodb-org-packages.rst b/source/includes/list-mongodb-org-packages.rst index af7921e3057..a5ba992eec8 100644 --- a/source/includes/list-mongodb-org-packages.rst +++ b/source/includes/list-mongodb-org-packages.rst @@ -35,7 +35,8 @@ Control Scripts --------------- The ``mongodb-org`` package includes various :term:`control scripts -`, including the init script |init-script-path|. +`, including the init script |init-script-path|. These scripts +are used to stop, start, and restart daemon processes. The package configures MongoDB using the ``/etc/mongod.conf`` file in conjunction with the control scripts. See @@ -45,4 +46,5 @@ configuration file. As of version |release|, there are no control scripts for :program:`mongos`. The :program:`mongos` process is used only in :doc:`sharding `. You can use the ``mongod`` init script -to derive your own :program:`mongos` control script. +to derive your own :program:`mongos` control script for use in such +environments. See the :program:`mongos` reference for configuration details. diff --git a/source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml b/source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml index 9cc62d0f0bc..58c529d65d4 100644 --- a/source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml +++ b/source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml @@ -32,6 +32,10 @@ action: baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/2.6/$basearch/ gpgcheck=0 enabled=1 + - pre: | + ``.repo`` files for each release can also be found `in the repository itself `_. + Remember that odd-numbered minor release versions (e.g. 2.5) are development versions and are unsuitable + for production deployment. --- title: Install the MongoDB Enterprise packages and associated tools. stepnum: 1 @@ -46,7 +50,7 @@ action: pre: "Issue the following command:" language: sh code: | - sudo yum install mongodb-enterprise + sudo yum install -y mongodb-enterprise --- stepnum: 2 title: Manage Installed Version @@ -62,7 +66,7 @@ action: that installs the ``2.6.1`` release of MongoDB: language: sh code: | - sudo yum install mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-2.6.1 mongodb-enterprise-mongos-2.6.1 mongodb-enterprise-tools-2.6.1 + sudo yum install -y mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-2.6.1 mongodb-enterprise-mongos-2.6.1 mongodb-enterprise-tools-2.6.1 - heading: text: Pin a specific version of MongoDB Enterprise. character: "'" diff --git a/source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml b/source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml index e2fbf1f7475..2f88cfc7c6a 100644 --- a/source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml +++ b/source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml @@ -37,7 +37,7 @@ action: command: language: sh code: | - sudo yum install mongodb-org + sudo yum install -y mongodb-org - pre: | To install a specific release of MongoDB, specify each component package individually and append the version number to the @@ -45,7 +45,7 @@ action: release of MongoDB: language: sh code: | - sudo yum install mongodb-org-2.6.1 mongodb-org-server-2.6.1 mongodb-org-shell-2.6.1 mongodb-org-mongos-2.6.1 mongodb-org-tools-2.6.1 + sudo yum install -y mongodb-org-2.6.1 mongodb-org-server-2.6.1 mongodb-org-shell-2.6.1 mongodb-org-mongos-2.6.1 mongodb-org-tools-2.6.1 - pre: | You can specify any available version of MongoDB. However ``yum`` will upgrade the packages when a newer version becomes available. To diff --git a/source/includes/steps-install-mongodb-on-ubuntu.yaml b/source/includes/steps-install-mongodb-on-ubuntu.yaml index d2456667650..9f73bf7ad32 100644 --- a/source/includes/steps-install-mongodb-on-ubuntu.yaml +++ b/source/includes/steps-install-mongodb-on-ubuntu.yaml @@ -45,7 +45,7 @@ action: pre: "Issue the following command:" language: sh code: | - sudo apt-get install mongodb-org + sudo apt-get install -y mongodb-org - heading: text: Install a specific release of MongoDB. character: "'" @@ -55,7 +55,7 @@ action: that installs the ``2.6.1`` release of MongoDB: language: sh code: | - apt-get install mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-mongos=2.6.1 mongodb-org-tools=2.6.1 + sudo apt-get install -y mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-mongos=2.6.1 mongodb-org-tools=2.6.1 - heading: text: Pin a specific version of MongoDB. character: "'" diff --git a/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml b/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml index b3254d44bc1..96878f6f188 100644 --- a/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml +++ b/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml @@ -15,14 +15,22 @@ ref: verify pre: | 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``. + ``/var/log/mongodb/mongod.log`` + for a line reading action: - pre: | - You can optionally ensure that MongoDB will start following a system - reboot by issuing the following command: - language: sh - code: | - sudo chkconfig mongod on + - language: none + code: | + [initandlisten] waiting for connections on port + + - pre: | + where ```` 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: + + language: sh + code: | + sudo chkconfig mongod on --- title: Stop MongoDB. stepnum: 3 diff --git a/source/includes/steps-run-mongodb-on-debian.yaml b/source/includes/steps-run-mongodb-on-debian.yaml index 68598cb227a..5af92b4be1f 100644 --- a/source/includes/steps-run-mongodb-on-debian.yaml +++ b/source/includes/steps-run-mongodb-on-debian.yaml @@ -14,7 +14,14 @@ ref: verify pre: | Verify that the :program:`mongod` process has started successfully by checking the contents of the log file at - ``/var/log/mongodb/mongod.log``. + ``/var/log/mongodb/mongod.log`` + for a line reading +action: + language: none + code: | + [initandlisten] waiting for connections on port +post: | + where ```` is the port configured in ``/etc/mongod.conf``, ``27017`` by default. --- title: Stop MongoDB. stepnum: 3 diff --git a/source/tutorial/install-mongodb-enterprise-on-debian.txt b/source/tutorial/install-mongodb-enterprise-on-debian.txt index 4f3a3743dce..6b63775817c 100644 --- a/source/tutorial/install-mongodb-enterprise-on-debian.txt +++ b/source/tutorial/install-mongodb-enterprise-on-debian.txt @@ -7,11 +7,16 @@ Install MongoDB Enterprise on Debian Overview -------- -Use this tutorial to install MongoDB Enterprise on Debian Linux systems. -The tutorial uses ``.deb`` packages to install. +Use this tutorial to install MongoDB Enterprise on Debian Linux systems from +``.deb`` packages. .. include:: /includes/list-mongodb-enterprise-packages.rst +Considerations +-------------- + +MongoDB only provides Enterprise packages for 64-bit versions of Debian Wheezy. + Install MongoDB Enterprise -------------------------- @@ -20,10 +25,6 @@ Install MongoDB Enterprise Run MongoDB Enterprise ---------------------- -The MongoDB Enterprise instance stores its data files in ``/var/lib/mongo`` -and its log files in ``/var/log/mongo``, and runs using the ``mongod`` -user account. 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/mongo`` directories. +.. include:: /includes/fact-directories-debian.rst .. include:: /includes/steps/run-mongodb-on-debian.rst diff --git a/source/tutorial/install-mongodb-enterprise-on-red-hat-or-centos.txt b/source/tutorial/install-mongodb-enterprise-on-red-hat-or-centos.txt index baa41fab101..9d33859b999 100644 --- a/source/tutorial/install-mongodb-enterprise-on-red-hat-or-centos.txt +++ b/source/tutorial/install-mongodb-enterprise-on-red-hat-or-centos.txt @@ -8,7 +8,7 @@ Overview -------- Use this tutorial to install MongoDB Enterprise on Red Hat Enterprise -Linux or CentOS Linux. The tutorial uses ``.rpm`` packages to install. +Linux or CentOS Linux from ``.rpm`` packages. .. The following include includes two h2 headers: .. Packages and Control Scripts @@ -16,10 +16,12 @@ Linux or CentOS Linux. The tutorial uses ``.rpm`` packages to install. .. include:: /includes/list-mongodb-enterprise-packages.rst Considerations -~~~~~~~~~~~~~~ +-------------- MongoDB only provides Enterprise packages for Red Hat -Enterprise Linux and CentOS Linux versions 5 and 6. +Enterprise Linux and CentOS Linux versions 5 and 6, 64-bit. + +.. include:: /includes/fact-installation-bind-ip-default-in-config.rst Install MongoDB Enterprise -------------------------- @@ -32,5 +34,10 @@ how to do both. Run MongoDB Enterprise ---------------------- +.. important:: + + .. include:: /includes/fact-selinux-redhat-options.rst + +.. include:: /includes/fact-directories-redhat.rst .. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst diff --git a/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt b/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt index 99e9adeb513..6085f3822f9 100644 --- a/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt +++ b/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt @@ -7,8 +7,8 @@ Install MongoDB Enterprise on Ubuntu Overview -------- -Use this tutorial to install MongoDB Enterprise on Ubuntu Linux systems. -The tutorial uses ``.deb`` packages to install. +Use this tutorial to install MongoDB Enterprise on Ubuntu Linux systems from +``.deb`` packages. .. include:: /includes/list-mongodb-enterprise-packages.rst @@ -16,7 +16,7 @@ Considerations -------------- MongoDB only provides Enterprise packages for Ubuntu -14.04 LTS (Precise Pangolin). +14.04 LTS (Precise Pangolin) 64-bit. Install MongoDB Enterprise -------------------------- @@ -26,10 +26,6 @@ Install MongoDB Enterprise Run MongoDB Enterprise ---------------------- -The MongoDB Enterprise instance stores its data files in ``/var/lib/mongo`` -and its log files in ``/var/log/mongo``, and runs using the ``mongod`` -user account. 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/mongo`` directories. +.. include:: /includes/fact-directories-debian.rst .. include:: /includes/steps/run-mongodb-on-debian.rst diff --git a/source/tutorial/install-mongodb-on-debian.txt b/source/tutorial/install-mongodb-on-debian.txt index 0e3121cc260..aec395d614f 100644 --- a/source/tutorial/install-mongodb-on-debian.txt +++ b/source/tutorial/install-mongodb-on-debian.txt @@ -7,8 +7,8 @@ Install MongoDB on Debian Overview -------- -Use this tutorial to install MongoDB on Debian systems. The tutorial uses -``.deb`` packages to install. While some Debian distributions include +Use this tutorial to install MongoDB on Debian systems from +``.deb`` packages. While some Debian distributions include their own MongoDB packages, the official MongoDB packages are generally more up to date. @@ -48,10 +48,6 @@ sign packages with GPG keys. Run MongoDB ----------- -The MongoDB instance stores its data files in ``/var/lib/mongo`` -and its log files in ``/var/log/mongo``, and runs using the ``mongod`` -user account. 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/mongo`` directories. +.. include:: /includes/fact-directories-debian.rst .. include:: /includes/steps/run-mongodb-on-debian.rst diff --git a/source/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux.txt b/source/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux.txt index 0b6737e59e9..c331024d4fb 100644 --- a/source/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux.txt +++ b/source/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux.txt @@ -8,8 +8,8 @@ Overview -------- Use this tutorial to install MongoDB on Red Hat Enterprise Linux, CentOS -Linux, Fedora Linux, or a related system. The tutorial uses ``.rpm`` -packages to install. While some of these distributions include their own +Linux, Fedora Linux, or a related system from ``.rpm`` +packages. While some of these distributions include their own MongoDB packages, the official MongoDB packages are generally more up to date. @@ -25,7 +25,7 @@ date. With the introduction of ``systemd`` in Fedora 15, the control scripts included in the packages available in the MongoDB downloads repository are not compatible with Fedora systems. A correction is - forthcoming, see :issue:`SERVER-7285` for more information, and in + forthcoming; see :issue:`SERVER-7285` for more information. In the mean time use your own control scripts *or* install using the procedure outlined in :doc:`/tutorial/install-mongodb-on-linux`. @@ -43,21 +43,10 @@ Install MongoDB Run MongoDB ----------- +.. important:: -.. important:: You must configure SELinux to allow MongoDB to start on - Fedora systems. Administrators have two options: + .. include:: /includes/fact-selinux-redhat-options.rst - - enable access to the relevant ports (e.g. 27017) for SELinux. See - :ref:`security-port-numbers` for more information on MongoDB's - :doc:`default ports `. - - - disable SELinux entirely. This requires a system reboot and may have - larger implications for your deployment. - -The MongoDB instance stores its data files in ``/var/lib/mongo`` -and its log files in ``/var/log/mongodb``, and runs using the ``mongod`` -user account. 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. +.. include:: /includes/fact-directories-redhat.rst .. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst diff --git a/source/tutorial/install-mongodb-on-ubuntu.txt b/source/tutorial/install-mongodb-on-ubuntu.txt index f3dac2c5bca..f613075e4ce 100644 --- a/source/tutorial/install-mongodb-on-ubuntu.txt +++ b/source/tutorial/install-mongodb-on-ubuntu.txt @@ -7,8 +7,8 @@ Install MongoDB on Ubuntu Overview -------- -Use this tutorial to install MongoDB on Ubuntu Linux systems. The tutorial -uses ``.deb`` packages to install. While Ubuntu includes its own MongoDB +Use this tutorial to install MongoDB on Ubuntu Linux systems from ``.deb`` +packages. While Ubuntu includes its own MongoDB packages, the official MongoDB packages are generally more up-to-date. .. note:: @@ -42,10 +42,6 @@ Install MongoDB Run MongoDB ----------- -The MongoDB instance stores its data files in ``/var/lib/mongodb`` -and its log files in ``/var/log/mongodb``, and runs using the ``mongodb`` -user account. If you change the user that runs the MongoDB process, you -**must** modify the access control rights to the ``/var/lib/mongodb`` and -``/var/log/mongodb`` directories. +.. include:: /includes/fact-directories-debian.rst .. include:: /includes/steps/run-mongodb-on-debian.rst