From ebb4445127665abe26a79b33a5ddb455699e50ec Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Tue, 1 Apr 2014 10:39:27 -0400 Subject: [PATCH] DOCS-2807 shared steps for install tutorials --- source/includes/fact-unix-control-scripts.rst | 9 - .../includes/fact-unix-data-and-log-dir.rst | 5 - .../list-mongodb-enterprise-packages.rst | 44 ++++ source/includes/list-mongodb-org-packages.rst | 44 ++++ .../steps-2.6-downgrade-authorization.yaml | 6 + ...configure-windows-service-for-mongodb.yaml | 58 +++++ ...-windows-with-kerberos-authentication.yaml | 10 +- ...-mongodb-with-kerberos-authentication.yaml | 10 +- ...eps-install-configure-debian-packages.yaml | 32 --- ...-install-mongodb-enterprise-on-amazon.yaml | 14 + ...s-install-mongodb-enterprise-on-linux.yaml | 23 ++ ...ngodb-enterprise-on-red-hat-or-centos.yaml | 39 +++ ...ps-install-mongodb-enterprise-on-suse.yaml | 14 + ...-install-mongodb-enterprise-on-ubuntu.yaml | 71 ++++++ ...install-mongodb-enterprise-on-windows.yaml | 20 ++ .../steps-install-mongodb-on-debian.yaml | 31 +++ .../steps-install-mongodb-on-linux-32.yaml | 35 +++ .../steps-install-mongodb-on-linux-64.yaml | 35 +++ .../steps-install-mongodb-on-linux.yaml | 30 +++ ...steps-install-mongodb-on-osx-manually.yaml | 35 +++ ...odb-on-red-hat-centos-or-fedora-linux.yaml | 61 +++++ .../steps-install-mongodb-on-ubuntu.yaml | 73 ++++++ .../steps-install-mongodb-on-windows.yaml | 68 +++++ .../includes/steps-install-on-linux-32.yaml | 38 --- .../includes/steps-install-on-linux-64.yaml | 38 --- source/includes/steps-install-on-linux.yaml | 13 - source/includes/steps-install-osx-manual.yaml | 38 --- .../steps-install-set-up-dbpath-osx.yaml | 15 -- .../includes/steps-install-set-up-dbpath.yaml | 26 -- ...intenance-task-on-replica-set-members.yaml | 16 +- ...s-run-mongodb-on-a-linux-distribution.yaml | 56 ++++ .../includes/steps-run-mongodb-on-debian.yaml | 44 ++++ .../includes/steps-run-mongodb-on-linux.yaml | 72 ++++++ .../steps-run-mongodb-on-windows.yaml | 84 ++++++ source/reference/glossary.txt | 5 + .../install-mongodb-enterprise-on-amazon.txt | 66 ++--- ...ongodb-enterprise-on-red-hat-or-centos.txt | 108 ++------ .../install-mongodb-enterprise-on-suse.txt | 64 ++--- .../install-mongodb-enterprise-on-ubuntu.txt | 179 ++----------- .../install-mongodb-enterprise-on-windows.txt | 65 ++--- source/tutorial/install-mongodb-on-debian.txt | 142 ++--------- source/tutorial/install-mongodb-on-linux.txt | 65 +---- source/tutorial/install-mongodb-on-os-x.txt | 128 ++++------ ...godb-on-red-hat-centos-or-fedora-linux.txt | 187 ++------------ source/tutorial/install-mongodb-on-ubuntu.txt | 168 ++---------- .../tutorial/install-mongodb-on-windows.txt | 241 ++---------------- 46 files changed, 1219 insertions(+), 1406 deletions(-) delete mode 100644 source/includes/fact-unix-control-scripts.rst delete mode 100644 source/includes/fact-unix-data-and-log-dir.rst create mode 100644 source/includes/list-mongodb-enterprise-packages.rst create mode 100644 source/includes/list-mongodb-org-packages.rst create mode 100644 source/includes/steps-configure-windows-service-for-mongodb.yaml delete mode 100644 source/includes/steps-install-configure-debian-packages.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-amazon.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-linux.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-suse.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml create mode 100644 source/includes/steps-install-mongodb-enterprise-on-windows.yaml create mode 100644 source/includes/steps-install-mongodb-on-debian.yaml create mode 100644 source/includes/steps-install-mongodb-on-linux-32.yaml create mode 100644 source/includes/steps-install-mongodb-on-linux-64.yaml create mode 100644 source/includes/steps-install-mongodb-on-linux.yaml create mode 100644 source/includes/steps-install-mongodb-on-osx-manually.yaml create mode 100644 source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml create mode 100644 source/includes/steps-install-mongodb-on-ubuntu.yaml create mode 100644 source/includes/steps-install-mongodb-on-windows.yaml delete mode 100644 source/includes/steps-install-on-linux-32.yaml delete mode 100644 source/includes/steps-install-on-linux-64.yaml delete mode 100644 source/includes/steps-install-on-linux.yaml delete mode 100644 source/includes/steps-install-osx-manual.yaml delete mode 100644 source/includes/steps-install-set-up-dbpath-osx.yaml delete mode 100644 source/includes/steps-install-set-up-dbpath.yaml create mode 100644 source/includes/steps-run-mongodb-on-a-linux-distribution.yaml create mode 100644 source/includes/steps-run-mongodb-on-debian.yaml create mode 100644 source/includes/steps-run-mongodb-on-linux.yaml create mode 100644 source/includes/steps-run-mongodb-on-windows.yaml diff --git a/source/includes/fact-unix-control-scripts.rst b/source/includes/fact-unix-control-scripts.rst deleted file mode 100644 index 4d746d7c6e2..00000000000 --- a/source/includes/fact-unix-control-scripts.rst +++ /dev/null @@ -1,9 +0,0 @@ -The packages include various :term:`control scripts `, -including the init script ``/etc/rc.d/init.d/mongod``. These packages -configure MongoDB using the ``/etc/mongod.conf`` file in conjunction -with the control scripts. - -As of version |release|, there are no control scripts for -:program:`mongos`. :program:`mongos` is only used in :doc:`sharding -deployments `. You can use the ``mongod`` init script -to derive your own :program:`mongos` control script. diff --git a/source/includes/fact-unix-data-and-log-dir.rst b/source/includes/fact-unix-data-and-log-dir.rst deleted file mode 100644 index 3dd44090068..00000000000 --- a/source/includes/fact-unix-data-and-log-dir.rst +++ /dev/null @@ -1,5 +0,0 @@ -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. diff --git a/source/includes/list-mongodb-enterprise-packages.rst b/source/includes/list-mongodb-enterprise-packages.rst new file mode 100644 index 00000000000..887cb24b7d2 --- /dev/null +++ b/source/includes/list-mongodb-enterprise-packages.rst @@ -0,0 +1,44 @@ +Packages +-------- + +The MongoDB Enterprise package repository contains five packages: + +- ``mongodb-enterprise`` + + This package is a ``metapackage`` that will automatically install + the four component packages listed below. + +- ``mongodb-enterprise-server`` + + This package contains the :program:`mongod` daemon and associated + configuration and init scripts. + +- ``mongodb-enterprise-mongos`` + + This package contains the :program:`mongos` daemon. + +- ``mongodb-enterprise-shell`` + + This package contains the :program:`mongo` shell. + +- ``mongodb-enterprise-tools`` + + This package contains the following MongoDB tools: :program:`mongoimport` + :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, + :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, + :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, + and :program:`mongotop`. + +Control Scripts +--------------- + +The ``mongodb-enterprise`` package includes various :term:`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. + +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. diff --git a/source/includes/list-mongodb-org-packages.rst b/source/includes/list-mongodb-org-packages.rst new file mode 100644 index 00000000000..49b11cd469b --- /dev/null +++ b/source/includes/list-mongodb-org-packages.rst @@ -0,0 +1,44 @@ +Packages +-------- + +The MongoDB package repository contains five packages: + +- ``mongodb-org`` + + This package is a ``metapackage`` that will automatically install + the four component packages listed below. + +- ``mongodb-org-server`` + + This package contains the :program:`mongod` daemon and associated + configuration and init scripts. + +- ``mongodb-org-mongos`` + + This package contains the :program:`mongos` daemon. + +- ``mongodb-org-shell`` + + This package contains the :program:`mongo` shell. + +- ``mongodb-org-tools`` + + This package contains the following MongoDB tools: :program:`mongoimport` + :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, + :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, + :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, + and :program:`mongotop`. + +Control Scripts +--------------- + +The ``mongodb-org`` package includes various :term:`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. + +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. diff --git a/source/includes/steps-2.6-downgrade-authorization.yaml b/source/includes/steps-2.6-downgrade-authorization.yaml index 5e2954138f2..a921d790130 100644 --- a/source/includes/steps-2.6-downgrade-authorization.yaml +++ b/source/includes/steps-2.6-downgrade-authorization.yaml @@ -1,6 +1,7 @@ title: text: Connect and authenticate to MongoDB instance. character: "`" +stepnum: 1 ref: connect-and-authenticate pre: | Connect and authenticate to the :program:`mongod` instance for a @@ -17,6 +18,7 @@ action: title: text: Create backup of 2.6 ``admin.system.users`` collection. character: "`" +stepnum: 2 ref: create-backup-of-new-users pre: | Copy all documents in the :data:`admin.system.users`` collection to @@ -32,6 +34,7 @@ action: title: text: Update the version document for the ``authSchema``. character: "`" +stepnum: 3 ref: update-version-schema-initial action: language: javascript @@ -44,6 +47,7 @@ action: title: text: "Remove existing documents from the ``admin.system.users`` collection." character: "`" +stepnum: 4 ref: remove-existing-documents action: language: javascript @@ -53,6 +57,7 @@ action: title: text: Copy documents from the ``admin.system.backup_users`` collection. character: "`" +stepnum: 5 ref: copy-backup-users pre: | Copy all documents from the ``admin.system.backup_users``, created during the @@ -69,6 +74,7 @@ action: title: text: Update the version document for the ``authSchema``. character: "`" +stepnum: 6 ref: update-version-schema-final action: language: javascript diff --git a/source/includes/steps-configure-windows-service-for-mongodb.yaml b/source/includes/steps-configure-windows-service-for-mongodb.yaml new file mode 100644 index 00000000000..29b4f433cc9 --- /dev/null +++ b/source/includes/steps-configure-windows-service-for-mongodb.yaml @@ -0,0 +1,58 @@ +title: Configure directories and files. +stepnum: 1 +ref: directories +pre: | + Create a :doc:`configuration file ` + and a directory path for MongoDB log output (:setting:`logpath`): +action: + - pre: | + Create a specific directory for MongoDB log files: + language: powershell + code: | + md "C:\Program Files\MongoDB\log" + - pre: | + In the :guilabel:`Command Prompt`, create a configuration file for + the :setting:`logpath` option for MongoDB: + language: powershell + code: | + echo logpath="C:\Program Files\MongoDB\log\mongo.log" > "C:\Program Files\MongoDB\mongod.cfg" +--- +title: Run the MongoDB service. +stepnum: 2 +ref: mongodb-service +pre: | + Run all of the following commands in :guilabel:`Command Prompt` with + "Administrative Privileges:" +action: + - pre: | + Install the MongoDB service. For :option:`--install ` to succeed, you *must* specify the :setting:`logpath` + run-time option. + language: powershell + code: | + "C:\Program Files\MongoDB\bin\mongod.exe" --config "C:\Program Files\MongoDB\mongod.cfg" --install + - pre: | + Modify the path to the ``mongod.cfg`` file as needed. +post: | + To use an alternate :setting:`dbpath`, specify the path in the + configuration file (e.g. ``C:\Program Files\MongoDB\mongod.cfg``) or + on the command line with the :option:`--dbpath ` option. + + If the :setting:`dbpath` directory does not exist, :program:`mongod.exe` + will not start. The default value for :setting:`dbpath` is ``\data\db``. +--- +title: Stop or remove the MongoDB service as needed. +stepnum: 3 +ref: stop +action: + - pre: | + To stop the MongoDB service use the following command: + language: powershell + code: | + net stop MongoDB + - pre: | + To remove the MongoDB service use the following command: + language: powershell + code: | + "C:\Program Files\MongoDB\bin\mongod.exe" --remove +... diff --git a/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml b/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml index 5f56a3d9869..590a856b9e4 100644 --- a/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml +++ b/source/includes/steps-control-access-to-mongodb-windows-with-kerberos-authentication.yaml @@ -1,6 +1,6 @@ +title: Start ``mongod.exe`` without Kerberos. stepnum: 1 ref: start-mongod-exe-without-kerberos-support -title: Start ``mongod.exe`` without Kerberos. pre: | For the initial addition of Kerberos users, start :program:`mongod.exe` without Kerberos support. @@ -10,18 +10,18 @@ post: | `, you can start :program:`mongod.exe` with Kerberos support. --- +title: Connect to ``mongod``. stepnum: 2 ref: connect-to-mongod -title: Connect to ``mongod``. pre: | Connect via the :program:`mongo.exe` shell to the :program:`mongod.exe` instance. If :program:`mongod.exe` has :option:`--auth` enabled, ensure you connect with the :ref:`privileges required to create a user `. --- +title: Add Kerberos Principal(s) to MongoDB. stepnum: 3 ref: add-kerberos-principals-windows -title: Add Kerberos Principal(s) to MongoDB pre: | Add a Kerberos principal, ``@``, to MongoDB in the ``$external`` database. Specify the Kerberos realm in @@ -51,9 +51,9 @@ post: | information about creating and managing users, see :doc:`/reference/command/nav-user-management`. --- +title: Start ``mongod.exe`` with Kerberos support. stepnum: 4 ref: start-mongod-exe-with-kerberos-support -title: Start ``mongod.exe`` with Kerberos Support pre: | You must start :program:`mongod.exe` as the :ref:`service principal account `. @@ -75,9 +75,9 @@ post: | Modify or include additional :program:`mongod.exe` options as required for your configuration. --- +title: Connect ``mongo.exe`` shell to ``mongod.exe`` and authenticate. stepnum: 5 ref: authenticate-a-user-within-mongo-shell -title: Connect ``mongo.exe`` Shell to ``mongod.exe`` and Authenticate pre: | Connect the :program:`mongo.exe` shell client as the Kerberos principal ``application@EXAMPLE.NET``. diff --git a/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml b/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml index cb65d316eed..90781b68d16 100644 --- a/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml +++ b/source/includes/steps-control-access-to-mongodb-with-kerberos-authentication.yaml @@ -1,6 +1,6 @@ +title: Start ``mongod`` without Kerberos. stepnum: 1 ref: start-mongod-without-kerberos-support -title: Start ``mongod`` without Kerberos. pre: | For the initial addition of Kerberos users, start :program:`mongod` without Kerberos support. @@ -10,18 +10,18 @@ post: | `, you can start :program:`mongod` with Kerberos support. --- +title: Connect to ``mongod``. stepnum: 2 ref: connect-to-mongod -title: Connect to ``mongod``. pre: | Connect via the :program:`mongo` shell to the :program:`mongod` instance. If :program:`mongod` has :option:`--auth` enabled, ensure you connect with the :ref:`privileges required to create a user `. --- +title: Add Kerberos Principal(s) to MongoDB. stepnum: 3 ref: add-kerberos-principals -title: Add Kerberos Principal(s) to MongoDB pre: | Add a Kerberos principal, ``@`` or ``/@``, to MongoDB in the @@ -52,9 +52,9 @@ post: | information about creating and managing users, see :doc:`/reference/command/nav-user-management`. --- +title: Start ``mongod`` with Kerberos support. stepnum: 4 ref: start-mongod-with-kerberos-support -title: Start ``mongod`` with Kerberos Support action: - pre: | To start :program:`mongod` with Kerberos support, set the @@ -88,9 +88,9 @@ post: | ``KRB5_KTNAME`` in a environment settings file. See :ref:`setting-krb5_ktname` for details. --- +title: Connect ``mongo`` shell to ``mongod`` and authenticate. stepnum: 5 ref: invoke-an-authenticated-mongo-shell -title: Connect ``mongo`` Shell to ``mongod`` and Authenticate pre: | Connect the :program:`mongo` shell client as the Kerberos principal ``application/reporting@EXAMPLE.NET``. Before connecting, you diff --git a/source/includes/steps-install-configure-debian-packages.yaml b/source/includes/steps-install-configure-debian-packages.yaml deleted file mode 100644 index ad433819477..00000000000 --- a/source/includes/steps-install-configure-debian-packages.yaml +++ /dev/null @@ -1,32 +0,0 @@ -title: - text: Import MongoDB PGP key. - character: '`' -stepnum: 1 -pre: | - Issue the following command to add the `MongoDB public GPG Key - `_ to the system key ring. -ref: import-apt-package-keyring -action: - - code: "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10" - language: sh ---- -title: - text: Create a ``sources.list`` file for MongoDB. - character: '`' -stepnum: 2 -pre: "Create a ``/etc/apt/sources.list.d/mongodb.list`` file" -ref: create-sources.list-file -action: - - code: "echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list" - language: sh ---- -title: - text: Reload local package database. - character: '`' -stepnum: 3 -pre: "Issue the following command to reload the local package database:" -ref: reload-package-database -action: - - code: "sudo apt-get update" - language: sh -... diff --git a/source/includes/steps-install-mongodb-enterprise-on-amazon.yaml b/source/includes/steps-install-mongodb-enterprise-on-amazon.yaml new file mode 100644 index 00000000000..8682e1ce934 --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-amazon.yaml @@ -0,0 +1,14 @@ +stepnum: 1 +source: + file: steps-install-mongodb-enterprise-on-linux.yaml + ref: sequence +# The content of the following include is auto-generated: +action: + pre: | + .. include:: /includes/install-curl-release-ent-amzn64.rst +--- +stepnum: 2 +source: + file: steps-install-mongodb-enterprise-on-linux.yaml + ref: ensure-binaries-in-path +... diff --git a/source/includes/steps-install-mongodb-enterprise-on-linux.yaml b/source/includes/steps-install-mongodb-enterprise-on-linux.yaml new file mode 100644 index 00000000000..5fea719b331 --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-linux.yaml @@ -0,0 +1,23 @@ +# This is a parent procedure that provides steps for other procedures to inherit. +# This procedure is NOT intended for direction inclusion in a tutorial. +# +title: Download and install the MongoDB Enterprise packages. +stepnum: 1 +ref: sequence +# When borrowing this step, you must include an action with a command sequence. +pre: | + After you have installed the required prerequisite packages, download + and install the MongoDB Enterprise packages from + ``_. The MongoDB + binaries are located in the ``/bin`` directory of the archive. To download + and install, use the following sequence of commands. +--- +title: Ensure the location of the MongoDB binaries is included in the ``PATH`` variable. +stepnum: 2 +ref: ensure-binaries-in-path +pre: | + 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. +... 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 new file mode 100644 index 00000000000..38ce3d39d56 --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-red-hat-or-centos.yaml @@ -0,0 +1,39 @@ +title: Install the MongoDB Enterprise packages and associated tools. +stepnum: 1 +ref: install +pre: | + When you install the packages, you choose which release to install. This + step provides the commands for both. +action: + - pre: | + To install the latest stable version of MongoDB Enterprise, issue the + following command: + language: sh + code: | + sudo yum install mongodb-enterprise + - pre: | + To install a specific release of MongoDB Enterprise, specify each + component package individually and append the version number to the + package name, as in the following example that installs the `2.6.1`` + release of MongoDB: + language: sh + code: | + 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 + - pre: | + You can specify any available version of MongoDB Enterprise. However + ``yum`` will upgrade the packages when a newer version becomes + available. To prevent unintended upgrades, pin the package. To pin a + package, add the following ``exclude`` directive to your + ``/etc/yum.conf`` file: + language: ini + code: | + exclude=mongodb-enterprise,mongodb-enterprise-server,mongodb-enterprise-shell,mongodb-enterprise-mongos,mongodb-enterprise-tools +post: | + Previous versions of MongoDB packages use different naming conventions. + See the :v2.4:`2.4 version of documentation for more information + `. +--- +title: When the install completes, you can run MongoDB. +stepnum: 2 +ref: install-completes +... diff --git a/source/includes/steps-install-mongodb-enterprise-on-suse.yaml b/source/includes/steps-install-mongodb-enterprise-on-suse.yaml new file mode 100644 index 00000000000..0034081c3f8 --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-suse.yaml @@ -0,0 +1,14 @@ +stepnum: 1 +source: + file: steps-install-mongodb-enterprise-on-linux.yaml + ref: sequence +# The content of the following include is auto-generated: +action: + pre: | + .. include:: /includes/install-curl-release-ent-suse11.rst +--- +stepnum: 2 +source: + file: steps-install-mongodb-enterprise-on-linux.yaml + ref: ensure-binaries-in-path +... diff --git a/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml b/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml new file mode 100644 index 00000000000..df8bf6d6582 --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml @@ -0,0 +1,71 @@ +stepnum: 1 +source: + file: steps-install-mongodb-on-ubuntu.yaml + ref: import-key +--- +title: Create a ``/etc/apt/sources.list.d/mongodb-enterprise.list`` file for MongoDB. +stepnum: 2 +ref: sources-list +action: + - pre: | + Create the list file using the following command: + language: sh + code: | + echo 'deb https://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list + - pre: | + If you'd like to install MongoDB Enterprise packages from a + particular :ref:`release series `, such as + 2.4 or 2.6, you can specify the release series in the repository + configuration. For example, to restrict your system to the 2.6 + release series, create a + ``/etc/yum.repos.d/mongodb-enterprise-2.6.repo`` file to hold the + following configuration information for the MongoDB Enterprise 2.6 + repository: + language: sh + code: | + echo 'deb https://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/2.6 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-2.6.list +--- +stepnum: 3 +source: + file: steps-install-mongodb-on-ubuntu.yaml + ref: reload +--- +title: Install the MongoDB Enterprise packages. +stepnum: 4 +ref: install +pre: | + When you install the packages, you choose whether to install the current + release or a previous one. This step provides instructions for both. +action: + - pre: | + To install the latest stable version of MongoDB Enterprise, issue + the following command: + language: sh + code: | + sudo apt-get install mongodb-enterprise + - pre: | + To install a specific release of MongoDB Enterprise, specify + each component package individually and append the version number to + the package name, as in the following example that installs the + `2.6.1`` release of MongoDB Enterprise: + language: sh + code: | + apt-get 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 + - pre: | + You can specify any available version of MongoDB Enterprise. However + ``apt-get`` will upgrade the packages when a newer version becomes + available. To prevent unintended upgrades, pin the package. To pin + the version of MongoDB Enterprise at the currently installed + version, issue the following command sequence: + language: sh + code: | + echo "mongodb-enterprise hold" | sudo dpkg --set-selections + echo "mongodb-enterprise-server hold" | sudo dpkg --set-selections + echo "mongodb-enterprise-shell hold" | sudo dpkg --set-selections + echo "mongodb-enterprise-mongos hold" | sudo dpkg --set-selections + echo "mongodb-enterprise-tools hold" | sudo dpkg --set-selections +post: | + Previous versions of MongoDB Enterprise packages use different naming + conventions. See the :v2.4:`2.4 version of documentation + ` for more information. +... diff --git a/source/includes/steps-install-mongodb-enterprise-on-windows.yaml b/source/includes/steps-install-mongodb-enterprise-on-windows.yaml new file mode 100644 index 00000000000..d5b3d8f533f --- /dev/null +++ b/source/includes/steps-install-mongodb-enterprise-on-windows.yaml @@ -0,0 +1,20 @@ +title: Download MongoDB Enterprise for Windows. +stepnum: 1 +ref: download +pre: | + Download the latest production release of `MongoDB Enterprise + `_ +--- +title: Install MongoDB Enterprise for Windows. +stepnum: 2 +ref: install +action: + pre: | + Run the downloaded MSI installer. Make configuration choices as + prompted. +post: | + MongoDB is self-contained and does not have any other system + dependencies. You can install MongoDB into any folder (e.g. + ``D:\test\mongodb``) and run it from there. The installation wizard + includes an option to select an installation directory. +... diff --git a/source/includes/steps-install-mongodb-on-debian.yaml b/source/includes/steps-install-mongodb-on-debian.yaml new file mode 100644 index 00000000000..770ef1df1f3 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-debian.yaml @@ -0,0 +1,31 @@ +title: Import the public key used by the package management system. +stepnum: 1 +ref: import-key +action: + pre: | + Issue the following command to add the `MongoDB public GPG Key + `_ to the system key ring. + language: sh + code: | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 +--- +title: Create a ``/etc/apt/sources.list.d/mongodb.list`` file for MongoDB. +stepnum: 2 +ref: sources-list +action: + pre: | + Create the list file using the following command: + language: sh + code: | + echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list +--- +stepnum: 3 +source: + file: steps-install-mongodb-on-ubuntu.yaml + ref: reload +--- +stepnum: 4 +source: + file: steps-install-mongodb-on-ubuntu.yaml + ref: install +... diff --git a/source/includes/steps-install-mongodb-on-linux-32.yaml b/source/includes/steps-install-mongodb-on-linux-32.yaml new file mode 100644 index 00000000000..e25c6debee3 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-linux-32.yaml @@ -0,0 +1,35 @@ +stepnum: 1 +source: + file: steps-install-mongodb-on-linux.yaml + ref: download +# The content of the following include is autogenerated: +action: + pre: | + For example, to download the latest release through the shell, issue + the following: + + .. include:: /includes/install-curl-release-linux-i686.rst +--- +stepnum: 2 +source: + file: steps-install-mongodb-on-linux.yaml + ref: extract +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-untar-release-linux-i686.rst +--- +stepnum: 3 +source: + file: steps-install-mongodb-on-linux.yaml + ref: copy-archive +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-copy-release-linux-i686.rst +--- +stepnum: 4 +source: + file: steps-install-mongodb-on-linux.yaml + ref: ensure-binaries-in-path +... diff --git a/source/includes/steps-install-mongodb-on-linux-64.yaml b/source/includes/steps-install-mongodb-on-linux-64.yaml new file mode 100644 index 00000000000..beb87c1daf8 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-linux-64.yaml @@ -0,0 +1,35 @@ +stepnum: 1 +source: + file: steps-install-mongodb-on-linux.yaml + ref: download +# The content of the following include is autogenerated: +action: + pre: | + For example, to download the latest release through the shell, issue + the following: + + .. include:: /includes/install-curl-release-linux-x86_64.rst +--- +stepnum: 2 +source: + file: steps-install-mongodb-on-linux.yaml + ref: extract +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-untar-release-linux-x86_64.rst +--- +stepnum: 3 +source: + file: steps-install-mongodb-on-linux.yaml + ref: copy-archive +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-copy-release-linux-x86_64.rst +--- +stepnum: 4 +source: + file: steps-install-mongodb-on-linux.yaml + ref: ensure-binaries-in-path +... diff --git a/source/includes/steps-install-mongodb-on-linux.yaml b/source/includes/steps-install-mongodb-on-linux.yaml new file mode 100644 index 00000000000..f56b3413b73 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-linux.yaml @@ -0,0 +1,30 @@ +# This is a parent procedure that provides steps for other procedures to inherit. +# This procedure is NOT intended for direct inclusion in a tutorial. +title: Download the binary files for the desired release of MongoDB. +stepnum: 1 +ref: download +pre: | + Download the binaries from ``https://www.mongodb.org/downloads``. +--- +# When borrowing this step, you must include an action with a command. +title: Extract the files from the downloaded archive. +stepnum: 2 +ref: extract +pre: | + For example, from a system shell, you can extract through the ``tar`` command: +--- +title: Copy the extracted archive to the target directory. +stepnum: 3 +ref: copy-archive +pre: | + Copy the extracted folder to the location from which MongoDB will run. +--- +title: Ensure the location of the binaries is in the ``PATH`` variable. +stepnum: 4 +ref: ensure-binaries-in-path +pre: | + The MongoDB binaries are in the ``bin/`` directory of the archive. To + ensure that the binaries are in your ``PATH``, you can modify your + ``PATH``. Or you can create symbolic links in your + :file:`/usr/local/bin` directory that point to to the MongoDB binaries. +... diff --git a/source/includes/steps-install-mongodb-on-osx-manually.yaml b/source/includes/steps-install-mongodb-on-osx-manually.yaml new file mode 100644 index 00000000000..c04e5252c97 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-osx-manually.yaml @@ -0,0 +1,35 @@ +stepnum: 1 +source: + file: steps-install-mongodb-on-linux.yaml + ref: download +# The content of the following include is autogenerated: +action: + pre: | + For example, to download the latest release through the shell, issue + the following: + + .. include:: /includes/install-curl-release-osx-x86_64.rst +--- +stepnum: 2 +source: + file: steps-install-mongodb-on-linux.yaml + ref: extract +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-untar-release-osx-x86_64.rst +--- +stepnum: 3 +source: + file: steps-install-mongodb-on-linux.yaml + ref: copy-archive +# The content of the following include is autogenerated: +action: + pre: | + .. include:: /includes/install-copy-release-osx-x86_64.rst +--- +stepnum: 4 +source: + file: steps-install-mongodb-on-linux.yaml + ref: ensure-binaries-in-path +... 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 new file mode 100644 index 00000000000..4fc2e40caa2 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-red-hat-centos-or-fedora-linux.yaml @@ -0,0 +1,61 @@ +title: Configure the package management system (YUM). +stepnum: 1 +ref: config-yum +pre: | + Create a ``/etc/yum.repos.d/mongodb.repo`` file to hold the + following configuration information for the MongoDB repository: +action: + - pre: | + If you are running a 64-bit system, use the following configuration: + language: cfg + code: | + [mongodb] + name=MongoDB Repository + baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ + gpgcheck=0 + enabled=1 + - pre: | + If you are running a 32-bit system, which is not recommended for + production deployments, use the following configuration: + language: cfg + code: | + [mongodb] + name=MongoDB Repository + baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/ + gpgcheck=0 + enabled=1 +--- +title: Install the MongoDB packages and associated tools. +stepnum: 2 +ref: install +pre: | + When you install the packages, you choose whether to install the current + release or a previous one. This step provides the commands for both. +action: + - pre: | + To install the latest stable version of MongoDB, issue the following + command: + language: sh + code: | + sudo yum install mongodb-org + - pre: | + 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 that installs the `2.6.1`` + release of MongoDB: + language: sh + code: | + 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 + - pre: | + You can specify any available version of MongoDB. However ``yum`` + will upgrade the packages when a newer version becomes available. To + prevent unintended upgrades, pin the package. To pin a package, add + the following ``exclude`` directive to your ``/etc/yum.conf`` file: + language: ini + code: | + exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools +post: | + Previous versions of MongoDB packages use different naming conventions. + See the :v2.4:`2.4 version of documentation for more information + `. +... diff --git a/source/includes/steps-install-mongodb-on-ubuntu.yaml b/source/includes/steps-install-mongodb-on-ubuntu.yaml new file mode 100644 index 00000000000..1b2c5383b34 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-ubuntu.yaml @@ -0,0 +1,73 @@ +title: Import the public key used by the package management system. +stepnum: 1 +ref: import-key +action: + pre: | + The Ubuntu package management tools (i.e. ``dpkg`` and ``apt``) ensure + package consistency and authenticity by requiring that distributors + sign packages with GPG keys. Issue the following command to import the + `MongoDB public GPG Key `_: + language: sh + code: | + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 +--- +title: Create a list file for MongoDB. +stepnum: 2 +ref: sources-list +action: + pre: | + Create the ``/etc/apt/sources.list.d/mongodb.list`` list file using + the following command: + language: sh + code: | + echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list +--- +title: Reload local package database. +stepnum: 3 +ref: reload +action: + pre: | + Issue the following command to reload the local package database: + language: sh + code: | + sudo apt-get update +--- +title: Install the MongoDB packages. +stepnum: 4 +ref: install +pre: | + When you install the packages, you choose whether to install the current + release or a previous one. This step provides instructions for both. +action: + - pre: | + To install the latest stable version of MongoDB, issue the following + command: + language: sh + code: | + sudo apt-get install mongodb-org + - pre: | + 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 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 + - pre: | + You can specify any available version of MongoDB. However + ``apt-get`` will upgrade the packages when a newer version becomes + available. To prevent unintended upgrades, pin the package. To pin + the version of MongoDB at the currently installed version, issue the + following command sequence: + language: sh + code: | + echo "mongodb-org hold" | sudo dpkg --set-selections + echo "mongodb-org-server hold" | sudo dpkg --set-selections + echo "mongodb-org-shell hold" | sudo dpkg --set-selections + echo "mongodb-org-mongos hold" | sudo dpkg --set-selections + echo "mongodb-org-tools hold" | sudo dpkg --set-selections +post: | + Previous versions of MongoDB packages use different naming conventions. + See the :v2.4:`2.4 version of documentation for more information + `. +... diff --git a/source/includes/steps-install-mongodb-on-windows.yaml b/source/includes/steps-install-mongodb-on-windows.yaml new file mode 100644 index 00000000000..8df6aa28914 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-windows.yaml @@ -0,0 +1,68 @@ +title: Determine which MongoDB build you need. +stepnum: 1 +ref: select-mongodb +pre: | + There are three builds of MongoDB for Windows: + + **MongoDB for Windows Server 2008 R2 edition** (i.e. 2008R2) runs only + on Windows Server 2008 R2, Windows 7 64-bit, and newer versions of + Windows. This build takes advantage of recent enhancements to the + Windows Platform and cannot operate on older versions of Windows. + + **MongoDB for Windows 64-bit** runs on any 64-bit version of Windows + newer than Windows XP, including Windows Server 2008 R2 and Windows 7 + 64-bit. + + **MongoDB for Windows 32-bit** runs on any 32-bit version of Windows + newer than Windows XP. 32-bit versions of MongoDB are only intended for + older systems and for use in testing and development systems. 32-bit + versions of MongoDB only support databases smaller than 2GB. +action: + pre: | + To find which version of Windows you are running, enter the following + command in the :guilabel:`Command Prompt`: + language: powershell + code: | + wmic os get osarchitecture +--- +title: Download MongoDB for Windows. +stepnum: 2 +ref: download +pre: | + Download the latest production release of MongoDB from the `MongoDB + downloads page `_. Ensure you download + the correct version of MongoDB for your Windows system. The 64-bit + versions of MongoDB does not work with 32-bit Windows. +--- +title: Extract the downloaded file. +stepnum: 3 +ref: extract +pre: | + In Windows Explorer, locate the downloaded MongoDB zip file, which + typically is located in the default ``Downloads`` folder. Extract the + downloaded zip file to ``C:\`` by right-clicking on the file, selecting + :guilabel:`Extract All`, and browsing to ``C:\``. +--- +title: Move the MongoDB folder to another location (optional). +stepnum: 4 +ref: move-folder +pre: | + For example, to move the folder to ``C:\mongodb``: + + Select :guilabel:`Start Menu` > :guilabel:`All Programs` > + :guilabel:`Accessories`. + + Right-click :guilabel:`Command Prompt` and select :guilabel:`Run as + Administrator` from the popup menu. +action: + pre: | + Issue the following commands: + language: powershell + code: | + cd \ + move C:\mongodb-win32-* C:\mongodb +post: | + MongoDB is self-contained and does not have any other system + dependencies. You can run MongoDB from any folder you choose. You may + install MongoDB in any folder (e.g. ``D:\test\mongodb``) +... diff --git a/source/includes/steps-install-on-linux-32.yaml b/source/includes/steps-install-on-linux-32.yaml deleted file mode 100644 index 03fa1c6bf37..00000000000 --- a/source/includes/steps-install-on-linux-32.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: - text: Download the Latest Release - character: '`' -stepnum: 1 -pre: In a system shell, download the latest release for 32-bit Linux. -ref: download-latest-version-32 -action: - pre: | - .. include:: /includes/install-curl-release-linux-i686.rst -post: You may optionally specify a different version to download. ---- -title: - text: Extract MongoDB From Archive - character: '`' -stepnum: 2 -pre: Extract the files from the downloaded archive. -ref: extract-archive-from-latest-32 -action: - pre: | - .. include:: /includes/install-untar-release-linux-i686.rst ---- -title: - text: Copy MongoDB to Target Directory - character: '`' -stepnum: 3 -optional: true -pre: 'Copy the extracted folder into another location, such as :file:`mongodb`.' -ref: extract-archive-from-latest-32 -action: - pre: | - .. include:: /includes/install-copy-release-linux-i686.rst ---- -stepnum: 4 -source: - file: steps-install-on-linux.yaml - ref: install-configure-path -ref: configure-search-path-32 -... \ No newline at end of file diff --git a/source/includes/steps-install-on-linux-64.yaml b/source/includes/steps-install-on-linux-64.yaml deleted file mode 100644 index 9c0171e2cd1..00000000000 --- a/source/includes/steps-install-on-linux-64.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: - text: Download the Latest Release - character: '`' -stepnum: 1 -pre: In a system shell, download the latest release for 64-bit Linux. -ref: download-latest-version-64 -action: - pre: | - .. include:: /includes/install-curl-release-linux-x86_64.rst -post: You may optionally specify a different version to download. ---- -title: - text: Extract MongoDB From Archive - character: '`' -stepnum: 2 -pre: Extract the files from the downloaded archive. -ref: extract-archive-from-latest-64 -action: - pre: | - .. include:: /includes/install-untar-release-linux-x86_64.rst ---- -title: - text: Copy MongoDB to Target Directory - character: '`' -stepnum: 3 -optional: true -pre: 'Copy the extracted folder into another location, such as :file:`mongodb`.' -ref: extract-archive-from-latest-64 -action: - pre: | - .. include:: /includes/install-copy-release-linux-x86_64.rst ---- -stepnum: 4 -source: - file: steps-install-on-linux.yaml - ref: install-configure-path -ref: configure-search-path-64 -... \ No newline at end of file diff --git a/source/includes/steps-install-on-linux.yaml b/source/includes/steps-install-on-linux.yaml deleted file mode 100644 index 4131dbe8ff9..00000000000 --- a/source/includes/steps-install-on-linux.yaml +++ /dev/null @@ -1,13 +0,0 @@ -title: - text: Configure Search Path - character: '`' -stepnum: 4 -optional: true -pre: | - To ensure that the downloaded binaries are in your ``PATH``, you can - modify your ``PATH`` and/or create symbolic links to the MongoDB - binaries in your :file:`/usr/local/bin` directory - (:file:`/usr/local/bin` is already in your ``PATH``). You can find - the MongoDB binaries in the ``bin/`` directory within the archive. -ref: install-configure-path -... diff --git a/source/includes/steps-install-osx-manual.yaml b/source/includes/steps-install-osx-manual.yaml deleted file mode 100644 index aba5176d307..00000000000 --- a/source/includes/steps-install-osx-manual.yaml +++ /dev/null @@ -1,38 +0,0 @@ -title: - text: Download the Latest Release - character: '`' -stepnum: 1 -pre: In a system shell, download the latest release for 64-bit OS X. -ref: download-latest-version-osx -action: - pre: | - .. include:: /includes/install-curl-release-osx-x86_64.rst -post: You may optionally specify a different version to download. ---- -title: - text: Extract MongoDB From Archive - character: '`' -stepnum: 2 -pre: Extract the files from the downloaded archive. -ref: extract-archive-from-latest-osx -action: - pre: | - .. include:: /includes/install-untar-release-osx-x86_64.rst ---- -title: - text: Copy MongoDB to Target Directory - character: '`' -stepnum: 3 -optional: true -pre: 'Copy the extracted folder into another location, such as :file:`mongodb`.' -ref: extract-archive-from-latest-osx -action: - pre: | - .. include:: /includes/install-copy-release-osx-x86_64.rst ---- -stepnum: 4 -source: - file: steps-install-on-linux.yaml - ref: install-configure-path -ref: configure-search-path-osx -... \ No newline at end of file diff --git a/source/includes/steps-install-set-up-dbpath-osx.yaml b/source/includes/steps-install-set-up-dbpath-osx.yaml deleted file mode 100644 index 403dca3c6e2..00000000000 --- a/source/includes/steps-install-set-up-dbpath-osx.yaml +++ /dev/null @@ -1,15 +0,0 @@ -stepnum: 1 -source: - file: steps-install-set-up-dbpath.yaml - ref: create-dbpath -ref: create-dbpath-osx ---- -stepnum: 2 -source: - file: steps-install-set-up-dbpath.yaml - ref: set-dbpath-permission -ref: set-dbpath-permissions-osx -action: - code: chown `id -u` /data/db - language: sh -... \ No newline at end of file diff --git a/source/includes/steps-install-set-up-dbpath.yaml b/source/includes/steps-install-set-up-dbpath.yaml deleted file mode 100644 index c20776b5547..00000000000 --- a/source/includes/steps-install-set-up-dbpath.yaml +++ /dev/null @@ -1,26 +0,0 @@ -title: - text: Create ``dbpath`` - character: '`' -stepnum: 1 -pre: 'To create the default :setting:`dbpath` directory, use the following command:' -ref: create-dbpath -action: - code: mkdir -p /data/db - language: sh ---- -title: - text: Set ``dbpath`` Permissions - character: '`' -stepnum: 2 -pre: | - Ensure that the user that runs the :program:`mongod` process has read and - write permissions to this directory. For example, if you will run the - :program:`mongod` process, change the owner of the :file:`/data/db` - directory: -ref: set-dbpath-permission -action: - code: chown mongodb /data/db - language: sh -post: | - You must create the ``mongodb`` user separately. -... \ No newline at end of file diff --git a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml index 7c40933c8f1..2773eae1dc0 100644 --- a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml +++ b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml @@ -9,7 +9,7 @@ action: --- title: Restart the secondary as a standalone on a different port. stepnum: 2 -ref: restart-the-secondary-as-a-standalone-on-a-different-port +ref: restart-diff-port pre: | At the operating system shell prompt, restart :program:`mongod` as a standalone instance running on a different port and *without* @@ -18,9 +18,9 @@ action: language: sh code: mongod --port 37017 --dbpath /srv/mongodb --- -ref: perform-maintenance-operations-on-the-secondary -stepnum: 3 title: Perform maintenance operations on the secondary. +stepnum: 3 +ref: maintenance-on-secondary pre: | While the member is a standalone, use the :program:`mongo` shell to perform maintenance: @@ -30,7 +30,7 @@ action: --- title: Restart ``mongod`` as a member of the replica set. stepnum: 4 -ref: restart-mongod-as-a-member-of-the-replica-set +ref: restart pre: | After performing all maintenance tasks, use the following procedure to restart the :program:`mongod` as a member of the replica set @@ -55,7 +55,7 @@ action: --- title: Perform maintenance on the primary last. stepnum: 5 -ref: perform-maintenance-on-the-primary-last +ref: maintenance-on-primary pre: | To perform maintenance on the primary after completing maintenance tasks on all secondaries, use :method:`rs.stepDown()` in the @@ -70,10 +70,4 @@ post: | After the primary steps down, the replica set will elect a new primary. See :doc:`/core/replica-set-elections` for more information about replica set elections. - - Repeat steps - :ref:`step-2-perform-maintenance-task-on-replica-set-members-restart-the-secondary-as-a-standalone-on-a-different-port`, - :ref:`step-3-perform-maintenance-task-on-replica-set-members-perform-maintenance-operations-on-the-secondary`, and - :ref:`step-4-perform-maintenance-task-on-replica-set-members-restart-mongod-as-a-member-of-the-replica-set` - on the former primary. ... diff --git a/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml b/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml new file mode 100644 index 00000000000..4abce89ad45 --- /dev/null +++ b/source/includes/steps-run-mongodb-on-a-linux-distribution.yaml @@ -0,0 +1,56 @@ +title: Start MongoDB. +stepnum: 1 +ref: start-mdb +action: + pre: | + You can start the :program:`mongod` process by issuing the following + command: + language: sh + code: | + sudo service mongodb start +--- +title: Verify that MongoDB has started successfully +stepnum: 2 +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``. +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 +--- +title: Stop MongoDB. +stepnum: 3 +ref: stop-mdb +action: + pre: | + As needed, you can stop the :program:`mongod` process by issuing the + following command: + language: sh + code: | + sudo service mongod stop +--- +title: Restart MongoDB. +stepnum: 4 +ref: restart-mdb +action: + pre: | + You can restart the :program:`mongod` process by issuing the following + command: + language: sh + code: | + sudo service mongod restart +post: | + You can follow the state of the process for errors or important messages + by watching the output in the ``/var/log/mongo/mongod.log`` file. +--- +stepnum: 5 +source: + file: steps-run-mongodb-on-linux.yaml + ref: begin +... diff --git a/source/includes/steps-run-mongodb-on-debian.yaml b/source/includes/steps-run-mongodb-on-debian.yaml new file mode 100644 index 00000000000..ac563d6f043 --- /dev/null +++ b/source/includes/steps-run-mongodb-on-debian.yaml @@ -0,0 +1,44 @@ +title: Start MongoDB. +stepnum: 1 +ref: start-mdb +action: + pre: | + Issue the following command to start :program:`mongod`: + language: sh + code: | + sudo /etc/init.d/mongod start +--- +title: Verify that MongoDB has started successfully +stepnum: 2 +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``. +--- +title: Stop MongoDB. +stepnum: 3 +ref: stop-mdb +action: + pre: | + As needed, you can stop the :program:`mongod` process by issuing the + following command: + language: sh + code: | + sudo /etc/init.d/mongod stop +--- +title: Restart MongoDB. +stepnum: 4 +ref: restart-mdb +action: + pre: | + Issue the following command to restart :program:`mongod`: + language: sh + code: | + sudo /etc/init.d/mongod restart +--- +stepnum: 5 +source: + file: steps-run-mongodb-on-linux.yaml + ref: begin +... diff --git a/source/includes/steps-run-mongodb-on-linux.yaml b/source/includes/steps-run-mongodb-on-linux.yaml new file mode 100644 index 00000000000..9498ec6c9fe --- /dev/null +++ b/source/includes/steps-run-mongodb-on-linux.yaml @@ -0,0 +1,72 @@ +title: Create the data directory. +stepnum: 1 +ref: create-dbpath +pre: | + Before you start MongoDB for the first time, create the directory to + which the :program:`mongod` process will write data. By default, the + :program:`mongod` process uses the ``/data/db`` directory. If you create + a directory other than this one, you must specify that directory in the + :setting:`dbpath` option when starting the :program:`mongod` process + later in this procedure. +action: + pre: | + The following example command creates the default ``/data/db`` directory: + language: sh + code: | + mkdir -p /data/db +--- +title: Set permissions for the data directory. +stepnum: 2 +ref: set-dbpath-permission +action: + pre: | + Before running :program:`mongod` for the first time, ensure that the + user account running :program:`mongod` has read and write permissions + for the directory. +--- +title: Run MongoDB. +stepnum: 3 +ref: start-mdb +pre: | + To run MongoDB, run the :program:`mongod` process at the system prompt. + If necessary, specify the path of the :program:`mongod` or data + directory. See the following examples. +action: + - heading: Run without specifying paths + pre: | + If your system ``PATH`` variable includes the location of the + :program:`mongod` binary and if you use the default data directory + (i.e., ``/data/db``), simply enter ``mongod`` at the system prompt: + language: sh + code: | + mongod + - heading: Specify the path of the :program:`mongod` + pre: | + If your ``PATH`` does not include the location of the + :program:`mongod` binary, enter the full path to the :program:`mongod` + binary at the system prompt: + language: sh + code: | + /mongod + - heading: Specify the path of the data directory + pre: | + If you do not use the default data directory (i.e., ``/data/db``), + specify the path to the data directory using the :option:`--dbpath + ` option: + language: sh + code: | + mongod --dbpath +--- +title: Stop MongoDB as needed. +stepnum: 4 +ref: stop-mdb +pre: | + To stop MongoDB, press ``Control+C`` in the terminal where the + :program:`mongod` instance is running. +--- +title: Begin using MongoDB. +stepnum: 5 +ref: begin +pre: | + To begin using MongoDB, see :doc:`/tutorial/getting-started`. +... diff --git a/source/includes/steps-run-mongodb-on-windows.yaml b/source/includes/steps-run-mongodb-on-windows.yaml new file mode 100644 index 00000000000..c1576ca6e38 --- /dev/null +++ b/source/includes/steps-run-mongodb-on-windows.yaml @@ -0,0 +1,84 @@ +title: Set up the MongoDB environment. +stepnum: 1 +ref: create-data-dir +action: + - pre: | + MongoDB requires a :term:`data directory ` to store all + data. MongoDB's default data directory path is ``\data\db``. Create + this folder using the following commands from a :guilabel:`Command + Prompt`: + language: powershell + code: | + md \data\db + - pre: | + You can specify an alternate path for data files using the + :option:`--dbpath ` option to + :program:`mongod.exe`, for example: + language: powershell + code: | + C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data + - pre: | + If your path includes spaces, enclose the entire path in double + quotes, for example: + language: powershell + code: | + C:\mongodb\bin\mongod.exe --dbpath "d:\test\mongo db data" +--- +title: Start MongoDB. +stepnum: 2 +ref: start +action: + pre: | + To start MongoDB, run :program:`mongod.exe`. For example, from the + :guilabel:`Command Prompt`: + language: powershell + code: | + C:\Program Files\MongoDB\bin\mongod.exe +post: | + This starts the main MongoDB database process. The ``waiting for + connections`` message in the console output indicates that the + :program:`mongod.exe` process is running successfully. + + Depending on the security level of your system, Windows may pop up a + :guilabel:`Security Alert` dialog box about blocking "some features" of + ``C:\Program Files\MongoDB\bin\mongod.exe`` from communicating on + networks. All users should select ``Private Networks, such as my home or + work network`` and click ``Allow access``. For additional information on + security and MongoDB, please read the :doc:`/core/security` page. +--- +title: Connect to MongoDB. +stepnum: 3 +ref: connect +pre: | + To connect to MongoDB through the :program:`mongo.exe ` shell, + open another :guilabel:`Command Prompt`. When connecting, specify the + data directory if necessary. This step provides several example + connection commands. +action: + - pre: | + If your MongoDB installation uses the default data directory, + connect without specifying the data directory: + language: powershell + code: | + C:\mongodb\bin\mongo.exe + - pre: | + If you installation uses a different data directory, specify the + directory when connecting, as in this example: + language: powershell + code: | + C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data + - pre: | + If your path includes spaces, enclose the entire path in double + quotes. For example: + language: powershell + code: | + C:\mongodb\bin\mongod.exe --dbpath "d:\test\mongo db data" +post: | + If you want to develop applications using .NET, see the documentation + of :ecosystem:`C# and MongoDB ` for more information. +--- +stepnum: 4 +source: + file: steps-run-mongodb-on-linux.yaml + ref: begin +... diff --git a/source/reference/glossary.txt b/source/reference/glossary.txt index ebd6ab9d998..c05198f9297 100644 --- a/source/reference/glossary.txt +++ b/source/reference/glossary.txt @@ -454,6 +454,11 @@ Glossary stores :term:`documents ` in :term:`collections ` within databases. + MongoDB Enterprise + A commercial edition of MongoDB that includes additional features. For + more information, see `MongoDB Subscriptions + `_. + mongos The routing and load balancing process that acts an interface between an application and a MongoDB :term:`sharded cluster`. See diff --git a/source/tutorial/install-mongodb-enterprise-on-amazon.txt b/source/tutorial/install-mongodb-enterprise-on-amazon.txt index 1016c798977..a08ced8b8f0 100644 --- a/source/tutorial/install-mongodb-enterprise-on-amazon.txt +++ b/source/tutorial/install-mongodb-enterprise-on-amazon.txt @@ -4,57 +4,45 @@ Install MongoDB Enterprise on Amazon Linux AMI .. default-domain:: mongodb -`MongoDB Enterprise -`_ is available on -select platforms and contains support for several features related to -security and monitoring. +Overview +-------- -This tutorial outlines the steps to install :term:`MongoDB` Enterprise -on Amazon Linux AMI. +Use this tutorial to install :term:`MongoDB Enterprise` on Amazon Linux +AMI. MongoDB Enterprise is available on select platforms and contains +support for several features related to security and monitoring. Prerequisites ------------- -To use MongoDB Enterprise, you must install several -prerequisites. Amazon Linux AMI requires: ``net-snmp``, -``net-snmp-libs``, ``openssl``, ``net-snmp-utils``, ``cyrus-sasl``, -``cyrus-sasl-lib``, ``cyrus-sasl-devel``, and -``cyrus-sasl-gssapi``. Issue a command that resembles the following to -install these packages: +To use MongoDB Enterprise on Amazon Linux AMI, you must install several +prerequisite packages: -.. code-block:: sh +- ``net-snmp`` +- ``net-snmp-libs`` +- ``openssl`` +- ``net-snmp-utils`` +- ``cyrus-sasl`` +- ``cyrus-sasl-lib`` +- ``cyrus-sasl-devel`` +- ``cyrus-sasl-gssapi`` - sudo yum install openssl net-snmp net-snmp-libs net-snmp-utils cyrus-sasl cyrus-sasl-lib cyrus-sasl-devel cyrus-sasl-gssapi +To install these packages, you can issue the following command: -Install MongoDB Enterprise Binaries ------------------------------------ +.. code-block:: sh -When you have installed the required packages, and `downloaded the -Enterprise packages -`_ you can install -the packages using the same procedure as a standard :doc:`installation -of MongoDB on Linux Systems `. You -can use the following command sequence to download and install the -binaries: + sudo yum install openssl net-snmp net-snmp-libs net-snmp-utils cyrus-sasl cyrus-sasl-lib cyrus-sasl-devel cyrus-sasl-gssapi -.. include:: /includes/install-curl-release-ent-amzn64.rst +Install MongoDB Enterprise +-------------------------- -Run MongoDB ------------ +.. note:: -.. note:: The Enterprise packages currently include an example SNMP - configuration file named ``mongod.conf``. This file is not a - MongoDB configuration file. + The Enterprise packages include an example SNMP configuration file + named ``mongod.conf``. This file is not a MongoDB configuration file. -.. include:: /tutorial/install-mongodb-on-linux.txt - :start-after: start-include-for-enterprise-tutorial - :end-before: end-include-for-enterprise-tutorial +.. include:: /includes/steps/install-mongodb-enterprise-on-amazon.rst -Next Steps ----------- +Run MongoDB Enterprise +---------------------- -As you begin to use MongoDB, consider the -:doc:`/tutorial/getting-started` and :doc:`/tutorial` resources. To -read about features only available in MongoDB Enterprise, consider: -:doc:`/tutorial/monitor-with-snmp` and -:doc:`/tutorial/control-access-to-mongodb-with-kerberos-authentication`. +.. include:: /includes/steps/run-mongodb-on-linux.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 c383406f12a..85796471305 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 @@ -2,103 +2,29 @@ Install MongoDB Enterprise on Red Hat Enterprise or CentOS ========================================================== -.. default-doma +.. default-domain:: mongodb -Install Packages -~~~~~~~~~~~~~~~~ +Overview +-------- -Issue the following command (as ``root`` or with ``sudo``) to install -MongoDB Enterprise and associated tools: +Use this tutorial to install MongoDB Enterprise on Red Hat Enterprise +Linux or CentOS Linux. The tutorial uses ``.rpm`` packages to install. -.. code-block:: sh +.. The following include includes two h2 headers: +.. Packages and Control Scripts - yum install mongodb-enterprise +.. include:: /includes/list-mongodb-enterprise-packages.rst -When this command completes, you have successfully installed MongoDB Enterprise! +Install MongoDB Enterprise +-------------------------- -.. _install-rhel-version-pinning-enterprise: +When you install the packages for MongoDB Enterprise, you choose whether +to install the current release or a previous one. This procedure describes +how to do both. -Manage Installed Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ +.. include:: /includes/steps/install-mongodb-enterprise-on-red-hat-or-centos.rst -You can use these packages to install specific releases of MongoDB -Enterprise. To install a specific release, you must specify the -component packages individually and append the version number to -the package names, as in the following example: +Run MongoDB Enterprise +---------------------- -.. code-block:: sh - - 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 - -This will install the ``2.6.1`` release of MongoDB Enterprise. You can specify -any available version and package of MongoDB Enterprise; however ``yum`` -**will** upgrade the packages when newer versions become available. Use the following *pinning* -procedure to prevent unintended upgrades. - -To pin the packages, add the following line to your ``/etc/yum.conf`` -file: - -.. code-block:: ini - - exclude=mongodb-enterprise,mongodb-enterprise-server,mongodb-enterprise-shell,mongodb-enterprise-mongos,mongodb-enterprise-tools - -.. note:: - - Previous versions of :term:`MongoDB` packages use different naming - conventions. See the :v2.4:`2.4 version of documentation for more - information `. - -Control Scripts ---------------- - -.. include:: /includes/fact-unix-control-scripts.rst - -Run MongoDB ------------ - -Start MongoDB -~~~~~~~~~~~~~ - -.. include:: /includes/fact-unix-data-and-log-dir.rst - -Start the :program:`mongod` process by issuing the following command -(as root or with ``sudo``): - -.. code-block:: sh - - sudo service mongod 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 - - sudo chkconfig mongod on - -Stop MongoDB -~~~~~~~~~~~~ - -Stop the :program:`mongod` process by issuing the following command -(as root or with ``sudo``): - -.. code-block:: sh - - sudo service mongod stop - -Restart MongoDB -~~~~~~~~~~~~~~~ - -You can restart the :program:`mongod` process by issuing the following -command (as root or with ``sudo``): - -.. code-block:: sh - - sudo service mongod 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. +.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst diff --git a/source/tutorial/install-mongodb-enterprise-on-suse.txt b/source/tutorial/install-mongodb-enterprise-on-suse.txt index fe6b8efadeb..3da94c06aeb 100644 --- a/source/tutorial/install-mongodb-enterprise-on-suse.txt +++ b/source/tutorial/install-mongodb-enterprise-on-suse.txt @@ -4,56 +4,44 @@ Install MongoDB Enterprise on SUSE .. default-domain:: mongodb -`MongoDB Enterprise -`_ is available on -select platforms and contains support for several features related to -security and monitoring. +Overview +-------- -This tutorial outlines the steps to install :term:`MongoDB` Enterprise -on SUSE Linux. +Use this tutorial to install :term:`MongoDB Enterprise` on SUSE Linux. +MongoDB Enterprise is available on select platforms and contains support +for several features related to security and monitoring. Prerequisites ------------- -To use MongoDB Enterprise, you must install several -prerequisites. SUSE Enterprise Linux requires ``libopenssl0_9_8``, ``libsnmp15``, -``net-snmp``, ``snmp-mibs``, ``cyrus-sasl``, -``cyrus-sasl-devel``, and ``cyrus-sasl-gssapi``. Issue the following -command to install these packages: +To use MongoDB Enterprise on SUSE Enterprise Linux, you must install +several prerequisite packages: -.. code-block:: sh +- ``libopenssl0_9_8`` +- ``libsnmp15`` +- ``net-snmp`` +- ``snmp-mibs`` +- ``cyrus-sasl`` +- ``cyrus-sasl-devel`` +- ``cyrus-sasl-gssapi`` - sudo zypper install libopenssl0_9_8 net-snmp libsnmp15 snmp-mibs ncyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi +To install these packages, you can issue the following command: -Install MongoDB Enterprise Binaries ------------------------------------ +.. code-block:: sh -When you have installed the required packages, and `downloaded the -Enterprise packages -`_ you can install -the packages using the same procedure as a standard :doc:`installation -of MongoDB on Linux Systems `. You -can use the following command sequence to download and install the -binaries: + sudo zypper install libopenssl0_9_8 net-snmp libsnmp15 snmp-mibs ncyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi -.. include:: /includes/install-curl-release-ent-suse11.rst +Install MongoDB Enterprise +-------------------------- -Run MongoDB ------------ +.. note:: -.. note:: The Enterprise packages currently include an example SNMP - configuration file named ``mongod.conf``. This file is not a - MongoDB configuration file. + The Enterprise packages include an example SNMP configuration file + named ``mongod.conf``. This file is not a MongoDB configuration file. -.. include:: /tutorial/install-mongodb-on-linux.txt - :start-after: start-include-for-enterprise-tutorial - :end-before: end-include-for-enterprise-tutorial +.. include:: /includes/steps/install-mongodb-enterprise-on-suse.rst -Next Steps ----------- +Run MongoDB Enterprise +---------------------- -As you begin to use MongoDB, consider the -:doc:`/tutorial/getting-started` and :doc:`/tutorial` resources. To -read about features only available in MongoDB Enterprise, consider: -:doc:`/tutorial/monitor-with-snmp` and -:doc:`/tutorial/control-access-to-mongodb-with-kerberos-authentication`. +.. include:: /includes/steps/run-mongodb-on-linux.rst diff --git a/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt b/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt index 762319e2bb1..a26086c871a 100644 --- a/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt +++ b/source/tutorial/install-mongodb-enterprise-on-ubuntu.txt @@ -4,174 +4,29 @@ Install MongoDB Enterprise on Ubuntu .. default-domain:: mongodb -This tutorial outlines the steps to install :term:`MongoDB` Enterprise -on Ubuntu Linux systems. The tutorial uses ``.deb`` packages to -install. - -Packages +Overview -------- -The MongoDB Enterprise package repository contains five packages: - -- ``mongodb-enterprise`` - - This package is a ``metapackage`` that will automatically install - the four component packages listed below. - -- ``mongodb-enterprise-server`` - - This package contains the :program:`mongod` daemon and associated - configuration and init scripts. - -- ``mongodb-enterprise-mongos`` - - This package contains the :program:`mongos` daemon. - -- ``mongodb-enterprise-shell`` - - This package contains the :program:`mongo` shell. - -- ``mongodb-enterprise-tools`` - - This package contains the following MongoDB tools: :program:`mongoimport` - :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, - :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, - :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, - and :program:`mongotop`. - -Install MongoDB ---------------- - -Configure Package Management System (APT) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Ubuntu package management tools (i.e. ``dpkg`` and ``apt``) -ensure package consistency and authenticity by requiring that -distributors sign packages with GPG keys. Issue the following command -to import the `MongoDB public GPG Key `_: - -.. code-block:: sh - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - -Create a ``/etc/apt/sources.list.d/mongodb-enterprise.list`` file using the -following command. - -.. code-block:: sh - - echo 'deb https://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/stable multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list - -If you'd like to install packages from a particular release series -of MongoDB Enterprise, such as 2.4, or 2.6, you can specify the -release series in the repository configuration (see :ref:`MongoDB -version number ` for more information). -For example, to restrict your system to the 2.6 release series, -create a ``/etc/yum.repos.d/mongodb-enterprise-2.6.repo`` file to -hold the following configuration information for the MongoDB -Enterprise 2.6 repository: - -.. code-block:: sh - - echo 'deb https://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/2.6 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-2.6.list - -Now issue the following command to reload your repository: - -.. code-block:: sh - - sudo apt-get update - -.. _install-ubuntu-version-pinning-enterprise: - -Install Packages -~~~~~~~~~~~~~~~~ - -Issue the following command to install the latest stable version of -MongoDB Enterprise: - -.. code-block:: sh - - sudo apt-get install mongodb-enterprise - -When this command completes, you have successfully installed MongoDB Enterprise! -Continue for configuration and start-up suggestions. - -Manage Installed Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can use these packages to install specific releases of MongoDB -Enterprise. To install a specific release, you must specify the -component packages individually and append the version number to -the package names, as in the following example: - -.. code-block:: sh - - apt-get 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 - -This will install the ``2.6.1`` release of MongoDB Enterprise. You can specify -any available version and package of MongoDB Enterprise; however ``apt-get`` -**will** upgrade the packages when newer versions become available. Use the following *pinning* -procedure to prevent unintended upgrades. - -To pin a package, issue the following commands at the system prompt to -*pin* the version of MongoDB Enterprise at the currently installed version: - -.. code-block:: sh - - echo "mongodb-enterprise hold" | sudo dpkg --set-selections - echo "mongodb-enterprise-server hold" | sudo dpkg --set-selections - echo "mongodb-enterprise-shell hold" | sudo dpkg --set-selections - echo "mongodb-enterprise-mongos hold" | sudo dpkg --set-selections - echo "mongodb-enterprise-tools hold" | sudo dpkg --set-selections - -.. note:: - - Previous versions of :term:`MongoDB` packages use different naming - conventions. See the :v2.4:`2.4 version of documentation for more - information `. - -Control Scripts ---------------- - -.. include:: /includes/fact-unix-control-scripts.rst - -Run MongoDB ------------ - -.. include:: /includes/fact-unix-data-and-log-dir.rst - -Start MongoDB -~~~~~~~~~~~~~ - -You can start the :program:`mongod` process by issuing the following -command: - -.. code-block:: sh - - sudo service mongodb start - -You can verify that :program:`mongod` has started successfully by checking the -contents of the log file at ``/var/log/mongodb/mongodb.log``. - -Stop MongoDB -~~~~~~~~~~~~ - -As needed, you may stop the :program:`mongod` process by issuing the -following command: +Use this tutorial to install MongoDB Enterprise on Ubuntu Linux systems. +The tutorial uses ``.deb`` packages to install. -.. code-block:: sh +.. The following include includes two h2 headers: +.. Packages and Control Scripts - sudo service mongod stop +.. include:: /includes/list-mongodb-enterprise-packages.rst -Restart MongoDB -~~~~~~~~~~~~~~~ +Install MongoDB Enterprise +-------------------------- -You may restart the :program:`mongod` process by issuing the -following command: +.. include:: /includes/steps/install-mongodb-enterprise-on-ubuntu.rst -.. code-block:: sh +Run MongoDB Enterprise +---------------------- - sudo service mongod restart +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. -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. +.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst diff --git a/source/tutorial/install-mongodb-enterprise-on-windows.txt b/source/tutorial/install-mongodb-enterprise-on-windows.txt index 9d79c702cb5..4ace6cc4c8d 100644 --- a/source/tutorial/install-mongodb-enterprise-on-windows.txt +++ b/source/tutorial/install-mongodb-enterprise-on-windows.txt @@ -6,57 +6,40 @@ Install MongoDB Enterprise on Windows .. versionadded:: 2.6 -Synopsis +Overview -------- -`MongoDB Enterprise `_ -is available on select platforms, including Windows, and contains -support for several features related to security and monitoring. Use -this procedure to install and configure the MongoDB Enterprise on -Windows systems. +Use this tutorial to install :term:`MongoDB Enterprise` on Windows +systems. MongoDB Enterprise is available on select platforms and contains +support for several features related to security and monitoring. -To install MongoDB Enterprise on other platforms, see -:doc:`/administration/install-enterprise`. +Prerequisites +------------- -Requirements ------------- +MongoDB Enterprise Server for Windows requires Windows Server 2008 R2 or +later. The MSI installer includes all other software dependencies. -MongoDB Enterprise Server for Windows requires Windows Server 2008 -R2 or later. The MSI installer includes all other software dependencies. +Install MongoDB Enterprise +-------------------------- -Procedures ----------- +.. include:: /includes/steps/install-mongodb-enterprise-on-windows.rst -.. the heading adornment in this section is unique to support - different nesting orders in the include/source +Run MongoDB Enterprise +---------------------- -Download MongoDB Enterprise for Windows -+++++++++++++++++++++++++++++++++++++++ +.. warning:: -Download the latest production release of `MongoDB Enterprise -`_ + Do not make :program:`mongod.exe` visible on public networks without + running in "Secure Mode" with the :setting:`auth` setting. MongoDB is + designed to be run in trusted environments, and the database does not + enable "Secure Mode" by default. -Install MongoDB Enterprise for Windows -++++++++++++++++++++++++++++++++++++++ - -Run the downloaded MSI installer. Make configuration choices as -prompted. - -MongoDB is self-contained and does not have any other -system dependencies. You can install MongoDB into any folder -(e.g. ``D:\test\mongodb``) and run it from there. The installation -wizard includes an option to select an installation directory. - -Run MongoDB Enterprise on Windows -+++++++++++++++++++++++++++++++++ - -.. include:: /tutorial/install-mongodb-on-windows.txt - :start-after: start-windows-operate-database - :end-before: end-windows-operate-database +.. include:: /includes/steps/run-mongodb-on-windows.rst Configure a Windows Service for MongoDB Enterprise -++++++++++++++++++++++++++++++++++++++++++++++++++ +-------------------------------------------------- + +You can set up the MongoDB server as a :guilabel:`Windows Service` that +starts automatically at boot time. -.. include:: /tutorial/install-mongodb-on-windows.txt - :start-after: start-configure-windows-service - :end-before: end-configure-windows-service +.. include:: /includes/steps/configure-windows-service-for-mongodb.rst diff --git a/source/tutorial/install-mongodb-on-debian.txt b/source/tutorial/install-mongodb-on-debian.txt index 79194af3302..49585b43f2a 100644 --- a/source/tutorial/install-mongodb-on-debian.txt +++ b/source/tutorial/install-mongodb-on-debian.txt @@ -4,10 +4,13 @@ Install MongoDB on Debian .. default-domain:: mongodb -This tutorial outlines the steps to install :term:`MongoDB` on Debian -systems. The tutorial uses ``.deb`` packages to install. While some -Debian distributions include their own MongoDB packages, the official -MongoDB packages are generally more up to date. +Overview +-------- + +Use this tutorial to install MongoDB on Debian systems. The tutorial uses +``.deb`` packages to install. While some Debian distributions include +their own MongoDB packages, the official MongoDB packages are generally +more up to date. .. note:: @@ -16,39 +19,13 @@ MongoDB packages are generally more up to date. users will want to follow the :doc:`/tutorial/install-mongodb-on-ubuntu` tutorial. -Package Options ---------------- - -The MongoDB package repository contains five packages: - -- ``mongodb-org`` - - This package is a ``metapackage`` that will automatically install - the four component packages listed below. - -- ``mongodb-org-server`` - - This package contains the :program:`mongod` daemon and associated - configuration and init scripts. - -- ``mongodb-org-mongos`` - - This package contains the :program:`mongos` daemon. - -- ``mongodb-org-shell`` - - This package contains the :program:`mongo` shell. - -- ``mongodb-org-tools`` +.. The following include includes two h2 headers: +.. Packages and Control Scripts - This package contains the following MongoDB tools: :program:`mongoimport` - :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, - :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, - :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, - and :program:`mongotop`. +.. include:: /includes/list-mongodb-org-packages.rst -Additionally you can :ref:`install previous releases ` -of MongoDB. +Considerations +-------------- You cannot install this package concurrently with the ``mongodb``, ``mongodb-server``, or ``mongodb-clients`` packages that @@ -57,100 +34,19 @@ your release of Debian may include. Install MongoDB --------------- -Configure Package Management System (APT) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The Debian package management tools (i.e. ``dpkg`` and ``apt``) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. -.. include:: /includes/steps/install-configure-debian-packages.rst - -Install Packages -~~~~~~~~~~~~~~~~ - -Issue the following command to install the latest stable version of -MongoDB: - -.. code-block:: sh - - sudo apt-get install mongodb-org - -When this command completes, you have successfully installed MongoDB! - -.. _install-debian-version-pinning: - -Manage Installed Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can use these packages to install specific versions of MongoDB. -To install a specific release, you must specify the component packages -individually and append the version number to the package name, as in -the following example: - -.. code-block:: sh - - 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 - -This will install the ``2.6.1`` release of MongoDB. You can specify -any available version and package of MongoDB; however ``apt-get`` -**will** upgrade the packages when newer versions become available. -Use the following *pinning* procedure to prevent unintended upgrades. - -To pin a package, issue the following command at the system prompt to -*pin* the version of MongoDB at the currently installed version: - -.. code-block:: sh - - echo "mongodb-org hold" | sudo dpkg --set-selections - echo "mongodb-org-server hold" | sudo dpkg --set-selections - echo "mongodb-org-shell hold" | sudo dpkg --set-selections - echo "mongodb-org-mongos hold" | sudo dpkg --set-selections - echo "mongodb-org-tools hold" | sudo dpkg --set-selections - -.. note:: - - Previous versions of :term:`MongoDB` packages use different naming - conventions. See the :v2.4:`2.4 version of documentation for more - information `. - - -Control Scripts ---------------- - -.. include:: /includes/fact-unix-control-scripts.rst +.. include:: /includes/steps/install-mongodb-on-debian.rst Run MongoDB ----------- -.. include:: /includes/fact-unix-data-and-log-dir.rst - -Start MongoDB -~~~~~~~~~~~~~ - -Issue the following command to start :program:`mongod`: - -.. code-block:: sh - - sudo /etc/init.d/mongod start - -You can verify that :program:`mongod` has started successfully by checking the -contents of the log file at ``/var/log/mongodb/mongod.log``. - -Stop MongoDB -~~~~~~~~~~~~ - -Issue the following command to stop :program:`mongod`: - -.. code-block:: sh - - sudo /etc/init.d/mongod stop - -Restart MongoDB -~~~~~~~~~~~~~~~ - -Issue the following command to restart :program:`mongod`: - -.. code-block:: sh +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. - sudo /etc/init.d/mongod restart +.. include:: /includes/steps/run-mongodb-on-debian.rst diff --git a/source/tutorial/install-mongodb-on-linux.txt b/source/tutorial/install-mongodb-on-linux.txt index 4d034fdd7cf..9cdc750b36a 100644 --- a/source/tutorial/install-mongodb-on-linux.txt +++ b/source/tutorial/install-mongodb-on-linux.txt @@ -4,11 +4,15 @@ Install MongoDB on Linux Systems .. default-domain:: mongodb + +Overview +-------- + Compiled versions of MongoDB for Linux provide a simple option for installing MongoDB for other Linux systems without supported packages. -Installation Process --------------------- +Install MongoDB +--------------- MongoDB provides archives for both 64-bit and 32-bit Linux. Follow the installation procedure appropriate for your system. @@ -16,65 +20,14 @@ installation procedure appropriate for your system. Install for 64-bit Linux ~~~~~~~~~~~~~~~~~~~~~~~~ -.. include:: /includes/steps/install-on-linux-64.rst +.. include:: /includes/steps/install-mongodb-on-linux-64.rst Install for 32-bit Linux ~~~~~~~~~~~~~~~~~~~~~~~~ -.. include:: /includes/steps/install-on-linux-32.rst +.. include:: /includes/steps/install-mongodb-on-linux-32.rst Run MongoDB ----------- -.. start-include-for-enterprise-tutorial - -Set Up the Data Directory -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Before you start :program:`mongod` for the first time, you will need -to create the data directory (i.e. :setting:`dbpath`). By default, :program:`mongod` writes -data to the ``/data/db`` directory. - -.. include:: /includes/steps/install-set-up-dbpath.rst - -You can specify an alternate path for data files using the -:option:`--dbpath ` option to :program:`mongod`. If -you use an alternate location for your data directory, ensure that this -user can write to the alternate data directory. - -Start MongoDB -~~~~~~~~~~~~~ - -To start :program:`mongod`, run the executable :program:`mongod` at the -system prompt. - -For example, if your ``PATH`` includes the location of the -:program:`mongod` binary, enter ``mongod`` at the system prompt. - -.. code-block:: sh - - mongod - -If your ``PATH`` does not include the location of the :program:`mongod` -binary, enter the full path to the :program:`mongod` binary. - -Starting :program:`mongod` without any arguments starts a MongoDB -instance that writes data to the ``/data/db`` directory. To specify an -alternate data directory, start :program:`mongod` with the -:option:`--dbpath ` option: - -.. code-block:: sh - - mongod --dbpath - -Whether using the default :file:`/data/db` or an alternate directory, -ensure that the user account running :program:`mongod` has read and -write permissions to the directory. - -Stop MongoDB -~~~~~~~~~~~~ - -To stop the :program:`mongod` instance, press ``Control+C`` in the -terminal where the :program:`mongod` instance is running. - -.. end-include-for-enterprise-tutorial +.. include:: /includes/steps/run-mongodb-on-linux.rst diff --git a/source/tutorial/install-mongodb-on-os-x.txt b/source/tutorial/install-mongodb-on-os-x.txt index 1b2fe27c586..ab418916a96 100644 --- a/source/tutorial/install-mongodb-on-os-x.txt +++ b/source/tutorial/install-mongodb-on-os-x.txt @@ -4,112 +4,72 @@ Install MongoDB on OS X .. default-domain:: mongodb -.. admonition:: Platform Support - - Starting in version 2.4, MongoDB only supports OS X versions 10.6 - (Snow Leopard) on Intel x86-64 and later. - -MongoDB is available through the popular OS X package manager `Homebrew -`_ or through the MongoDB Download -site. - -Install MongoDB with Homebrew ------------------------------ - -`Homebrew `_ [#homebrew-setup]_ -installs binary packages based on published "formulae". The following -commands will update ``brew`` to the latest packages and install -MongoDB. - -In a terminal shell, use the following sequence of commands to -update``brew`` to the latest packages and install MongoDB: - -.. code-block:: sh - - brew update - brew install mongodb +Overview +-------- -Later, if you need to upgrade MongoDB, run the following -sequence of commands to update the MongoDB installation on your system: +Use this tutorial to install MongoDB on on OS X systems. -.. code-block:: sh - - brew update - brew upgrade mongodb - -Optionally, you can choose to build MongoDB from source. Use the -following command to build MongoDB with SSL support: - -.. code-block:: sh - - brew install mongodb --with-openssl - -You can also install the latest development release of MongoDB for -testing and development with the following command: +.. admonition:: Platform Support -.. code-block:: sh + Starting in version 2.4, MongoDB only supports OS X versions 10.6 (Snow + Leopard) on Intel x86-64 and later. - brew install mongodb --devel +MongoDB is available through the popular OS X package manager `Homebrew +`_ or through the `MongoDB Download site +`_. -.. [#homebrew-setup] Homebrew requires some initial - setup and configuration. This configuration is beyond the scope of - this document. +Install MongoDB +--------------- -.. _install-manual-osx: +You can install MongoDB with `Homebrew `_ or manually. +This section describes both. -Manual Installation -------------------- +Install MongoDB with Homebrew +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. include:: /includes/steps/install-osx-manual.rst +`Homebrew `_ installs binary packages based on published +"formulae". This section describes how to update ``brew`` to the latest +packages and install MongoDB. Homebrew requires some initial setup and +configuration, which is beyond the scope of this document. -Run MongoDB ------------ +You can install MongoDB with via ``brew`` in several different ways: -Set Up the Data Directory -~~~~~~~~~~~~~~~~~~~~~~~~~ +- In a terminal shell, use the following sequence of commands to + update``brew`` to the latest packages and install MongoDB: -Before you start :program:`mongod` for the first time, you will need to -create the data directory. By default, :program:`mongod` writes data to -the :file:`/data/db/` directory. + .. code-block:: sh -.. include:: /includes/steps/install-set-up-dbpath-osx.rst + brew update + brew install mongodb -You can specify an alternate path for data files using the -:option:`--dbpath ` option to :program:`mongod`. If -you use an alternate location for your data directory, ensure that the -alternate directory has the appropriate permissions. + If you later need to upgrade MongoDB, you can run the following sequence + of commands: -Start MongoDB -~~~~~~~~~~~~~ + .. code-block:: sh -To start :program:`mongod`, run the executable :program:`mongod` at the -system prompt. + brew update + brew upgrade mongodb -For example, if your ``PATH`` includes the location of the -:program:`mongod` binary, enter ``mongod`` at the system prompt. +- Build MongoDB from source. In a terminal shell, use the following + command to build MongoDB with SSL support: -.. code-block:: sh + .. code-block:: sh - mongod + brew install mongodb --with-openssl -If your ``PATH`` does not include the location of the :program:`mongod` -binary, enter the full path to the :program:`mongod` binary. +- Install the latest development release of MongoDB for testing and + development with the following command: -The previous command starts a :program:`mongod` instance that writes -data to the ``/data/db/`` directory. To specify an alternate data -directory, start :program:`mongod` with the :option:`--dbpath ` option: + .. code-block:: sh -.. code-block:: sh + brew install mongodb --devel - mongod --dbpath +Install MongoDB Manually +~~~~~~~~~~~~~~~~~~~~~~~~ -Whether using the default :file:`/data/db/` or an alternate directory, -ensure that the user account running :program:`mongod` has read and -write permissions to the directory. +.. include:: /includes/steps/install-mongodb-on-osx-manually.rst -Stop MongoDB -~~~~~~~~~~~~ +Run MongoDB +----------- -To stop the :program:`mongod` instance, press ``Control+C`` in the -terminal where the :program:`mongod` instance is running. +.. include:: /includes/steps/run-mongodb-on-linux.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 869be722075..bb2d87f843d 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 @@ -4,139 +4,41 @@ Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux .. default-domain:: mongodb -This tutorial outlines the steps to install :term:`MongoDB` on -Red Hat Enterprise Linux, CentOS Linux, Fedora Linux and related -systems. The tutorial uses ``.rpm`` packages to install. While some of -these distributions include their own MongoDB packages, the official -MongoDB packages are generally more up to date. - -Packages +Overview -------- -The MongoDB package repository contains five packages: - -- ``mongodb-org`` - - This package is a ``metapackage`` that will automatically install - the four component packages listed below. - -- ``mongodb-org-server`` - - This package contains the :program:`mongod` daemon and associated - configuration and init scripts. - -- ``mongodb-org-mongos`` - - This package contains the :program:`mongos` daemon. - -- ``mongodb-org-shell`` - - This package contains the :program:`mongo` shell. - -- ``mongodb-org-tools`` - - This package contains the following MongoDB tools: :program:`mongoimport` - :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, - :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, - :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, - and :program:`mongotop`. - -Install MongoDB ---------------- - -Configure Package Management System (YUM) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Create a ``/etc/yum.repos.d/mongodb.repo`` file to hold the -following configuration information for the MongoDB repository: - -.. tip:: For production deployments, always run MongoDB on 64-bit - systems. - -If you are running a 64-bit system, use the following configuration: - -.. code-block:: cfg - - [mongodb] - name=MongoDB Repository - baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ - gpgcheck=0 - enabled=1 - -If you are running a 32-bit system, which is not recommended for -production deployments, use the following configuration: - -.. code-block:: cfg - - [mongodb] - name=MongoDB Repository - baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/ - gpgcheck=0 - enabled=1 - -Install Packages -~~~~~~~~~~~~~~~~ - -Issue the following command (as ``root`` or with ``sudo``) to install -the latest stable version of MongoDB and associated tools: - -.. code-block:: sh - - yum install mongodb-org - -When this command completes, you have successfully installed MongoDB! - -.. _install-rhel-version-pinning: - -Manage Installed Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ +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 +MongoDB packages, the official MongoDB packages are generally more up to +date. -You can use these packages to install specific releases of MongoDB. -To install a specific release, you must specify the component packages -individually and append the version number to the package names, -as in the following example: +.. The following include includes two h2 headers: +.. Packages and Control Scripts -.. code-block:: sh - - 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 - -This will install the ``2.6.1`` release of MongoDB. You can specify -any available version of MongoDB; however ``yum`` **will** upgrade the -packages when a newer version becomes available. Use the following -*pinning* procedure to prevent unintended upgrades. - -To pin a package, add the following line to your ``/etc/yum.conf`` -file: - -.. code-block:: ini - - exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools - -.. note:: - - Previous versions of :term:`MongoDB` packages use different naming - conventions. See the :v2.4:`2.4 version of documentation for more - information `. - -Control Scripts ---------------- +.. include:: /includes/list-mongodb-org-packages.rst .. warning:: - With the introduction of ``systemd`` in Fedora 15, the control - scripts included in the packages available in the MongoDB downloads repository + 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 the mean time use your own control scripts *or* install using the procedure outlined in :doc:`/tutorial/install-mongodb-on-linux`. -.. include:: /includes/fact-unix-control-scripts.rst +Install MongoDB +--------------- + +For production deployments, always run MongoDB on 64-bit systems. + +.. include:: /includes/steps/install-mongodb-on-red-hat-centos-or-fedora-linux.rst Run MongoDB ----------- -.. important:: You must configure SELinux to allow MongoDB to start on Fedora systems. - Administrators have two options: +.. important:: You must configure SELinux to allow MongoDB to start on + Fedora systems. Administrators have two options: - enable access to the relevant ports (e.g. 27017) for SELinux. See :ref:`security-port-numbers` for more information on MongoDB's @@ -145,49 +47,10 @@ Run MongoDB - disable SELinux entirely. This requires a system reboot and may have larger implications for your deployment. -Start MongoDB -~~~~~~~~~~~~~ - -.. include:: /includes/fact-unix-data-and-log-dir.rst - -Start the :program:`mongod` process by issuing the following command -(as root or with ``sudo``): - -.. code-block:: sh - - service mongod start - -You can verify that the :program:`mongod` process has started -successfully by checking the contents of the log file at -``/var/log/mongo/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 mongod on - -Stop MongoDB -~~~~~~~~~~~~ - -Stop the :program:`mongod` process by issuing the following command -(as root or with ``sudo``): - -.. code-block:: sh - - service mongod stop - -Restart MongoDB -~~~~~~~~~~~~~~~ - -You can restart the :program:`mongod` process by issuing the following -command (as root or with ``sudo``): - -.. code-block:: sh - - service mongod restart +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. -Follow the state of this process by watching the output in the -``/var/log/mongo/mongod.log`` file to watch for errors or important -messages from the server. +.. 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 abd934e1dcd..72a7fbceef7 100644 --- a/source/tutorial/install-mongodb-on-ubuntu.txt +++ b/source/tutorial/install-mongodb-on-ubuntu.txt @@ -4,50 +4,23 @@ Install MongoDB on Ubuntu .. default-domain:: mongodb -This tutorial outlines the steps to install :term:`MongoDB` on Ubuntu -Linux systems. The tutorial uses ``.deb`` packages to install. Although -Ubuntu include its own MongoDB packages, the official MongoDB packages -are generally more up to date. +Overview +-------- + +Use this tutorial to install MongoDB on Ubuntu Linux systems. The tutorial +uses ``.deb`` packages to install. While Ubuntu includes its own MongoDB +packages, the official MongoDB packages are generally more up-to-date. .. note:: - If you use an older Ubuntu that does **not** use Upstart, (i.e. any - version before 9.10 "Karmic") please follow the instructions on the + If you use an older Ubuntu that does **not** use Upstart (i.e. any + version before 9.10 "Karmic"), please follow the instructions on the :doc:`install-mongodb-on-debian` tutorial. -Package Options ---------------- - -The MongoDB package repository contains five packages: - -- ``mongodb-org`` - - This package is a ``metapackage`` that will automatically install - the four component packages listed below. - -- ``mongodb-org-server`` - - This package contains the :program:`mongod` daemon and associated - configuration and init scripts. +.. The following include includes two h2 headers: +.. Packages and Control Scripts -- ``mongodb-org-mongos`` - - This package contains the :program:`mongos` daemon. - -- ``mongodb-org-shell`` - - This package contains the :program:`mongo` shell. - -- ``mongodb-org-tools`` - - This package contains the following MongoDB tools: :program:`mongoimport` - :program:`bsondump`, :program:`mongodump`, :program:`mongoexport`, - :program:`mongofiles`, :program:`mongoimport`, :program:`mongooplog`, - :program:`mongoperf`, :program:`mongorestore`, :program:`mongostat`, - and :program:`mongotop`. - -Additionally you can :ref:`install previous releases ` -of MongoDB. +.. include:: /includes/list-mongodb-org-packages.rst You cannot install this package concurrently with the ``mongodb``, ``mongodb-server``, or ``mongodb-clients`` packages provided by Ubuntu. @@ -55,120 +28,15 @@ You cannot install this package concurrently with the ``mongodb``, Install MongoDB --------------- -Configure Package Management System (APT) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Ubuntu package management tool (i.e. ``dpkg`` and ``apt``) -ensure package consistency and authenticity by requiring that -distributors sign packages with GPG keys. Issue the following command -to import the `MongoDB public GPG Key `_: - -.. code-block:: sh - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - -Create a ``/etc/apt/sources.list.d/mongodb.list`` file using the -following command. - -.. code-block:: sh - - echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list - -Now issue the following command to reload your repository: - -.. code-block:: sh - - sudo apt-get update - -.. _install-ubuntu-version-pinning: - -Install Packages -~~~~~~~~~~~~~~~~ - -Issue the following command to install the latest stable version of -MongoDB: - -.. code-block:: sh - - sudo apt-get install mongodb-org - -When this command completes, you have successfully installed MongoDB! -Continue for configuration and start-up suggestions. - -Manage Installed Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can use these packages to install specific versions of MongoDB. -To install a specific release, you must specify the component packages -individually and append the version number to the package name, as in -the following example: - -.. code-block:: sh - - 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 - -This will install the ``2.6.1`` release of MongoDB. You can specify -any available version and package of MongoDB; however ``apt-get`` -**will** upgrade the packages when newer versions become available. -Use the following *pinning* procedure to prevent unintended upgrades. - -To pin a package, issue the following command at the system prompt to -*pin* the version of MongoDB at the currently installed version: - -.. code-block:: sh - - echo "mongodb-org hold" | sudo dpkg --set-selections - echo "mongodb-org-server hold" | sudo dpkg --set-selections - echo "mongodb-org-shell hold" | sudo dpkg --set-selections - echo "mongodb-org-mongos hold" | sudo dpkg --set-selections - echo "mongodb-org-tools hold" | sudo dpkg --set-selections - -.. note:: - - Previous versions of :term:`MongoDB` packages use different naming - conventions. See the :v2.4:`2.4 version of documentation for more - information `. - -Control Scripts ---------------- - -.. include:: /includes/fact-unix-control-scripts.rst +.. include:: /includes/steps/install-mongodb-on-ubuntu.rst Run MongoDB ----------- -.. include:: /includes/fact-unix-data-and-log-dir.rst - - -Start MongoDB -~~~~~~~~~~~~~ - -You can start the :program:`mongod` process by issuing the following -command: - -.. code-block:: sh - - sudo service mongod start - -You can verify that :program:`mongod` has started successfully by checking the -contents of the log file at ``/var/log/mongodb/mongod.log``. - -Stop MongoDB -~~~~~~~~~~~~ - -As needed, you may stop the :program:`mongod` process by issuing the -following command: - -.. code-block:: sh - - sudo service mongod stop - -Restart MongoDB -~~~~~~~~~~~~~~~ - -You may restart the :program:`mongod` process by issuing the -following command: - -.. code-block:: sh +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. - sudo service mongod restart +.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst diff --git a/source/tutorial/install-mongodb-on-windows.txt b/source/tutorial/install-mongodb-on-windows.txt index 7159a05764c..69b4673e0e3 100644 --- a/source/tutorial/install-mongodb-on-windows.txt +++ b/source/tutorial/install-mongodb-on-windows.txt @@ -4,6 +4,11 @@ Install MongoDB on Windows .. default-domain:: mongodb +Overview +-------- + +Use this tutorial to install MongoDB on a Windows systems. + .. admonition:: Platform Support Starting in version 2.2, MongoDB does not support Windows XP. Please @@ -14,243 +19,29 @@ Install MongoDB on Windows R2 or Windows 7, please install `a hotfix to resolve an issue with memory mapped files on Windows `_. -Procedure ---------- - -Select MongoDB for Windows -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -There are three builds of MongoDB for Windows: - -- MongoDB for Windows Server 2008 R2 edition (i.e. 2008R2) - only runs on Windows Server 2008 R2, Windows 7 64-bit, and newer - versions of Windows. This build takes advantage of recent - enhancements to the Windows Platform and cannot operate on older - versions of Windows. - -- MongoDB for Windows 64-bit runs on any 64-bit version of Windows - newer than Windows XP, including Windows Server 2008 R2 and Windows - 7 64-bit. - -- MongoDB for Windows 32-bit runs on any 32-bit version of Windows - newer than Windows XP. 32-bit versions of MongoDB are only intended - for older systems and for use in testing and development systems. - 32-bit versions of MongoDB only support databases smaller than 2GB. - -.. tip:: - - To find which version of Windows you are running, enter the - following command in the :guilabel:`Command Prompt`: - - .. code-block:: powershell - - wmic os get osarchitecture - -Download MongoDB for Windows -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -#. Download the latest production release of MongoDB from the `MongoDB - downloads page `_. Ensure you - download the correct version of MongoDB for your Windows system. The - 64-bit versions of MongoDB will not work with 32-bit Windows. - -#. Extract the downloaded archive. - - a. In Windows Explorer, find the MongoDB download file, typically in - the default ``Downloads`` directory. - - #. Extract the archive to ``C:\`` by right clicking on the archive - and selecting :guilabel:`Extract All` and browsing to ``C:\``. - -#. Optional. Move the MongoDB directory to another location. For - example, to move the directory to ``C:\mongodb`` directory: - - a. Go :guilabel:`Start Menu` > :guilabel:`All Programs` > - :guilabel:`Accessories`. - - #. Right click :guilabel:`Command Prompt`, and select :guilabel:`Run - as Administrator` from the popup menu. - - #. In the :guilabel:`Command Prompt`, issue the following commands: +Install MongoDB +--------------- - .. code-block:: powershell - - cd \ - move C:\mongodb-win32-* C:\mongodb - -.. note:: - - MongoDB is self-contained and does not have any other system - dependencies. You can run MongoDB from any folder you choose. You - may install MongoDB in any directory (e.g. ``D:\test\mongodb``) +.. include:: /includes/steps/install-mongodb-on-windows.rst Run MongoDB ----------- -.. _set-up-data-directory: - -.. start-windows-operate-database - -Set up the Environment -~~~~~~~~~~~~~~~~~~~~~~ - -MongoDB requires a :term:`data folder ` to store all -data. MongoDB's default data directory path is ``\data\db``. Create -this folder using the following commands from a :guilabel:`Command -Prompt`: - -.. code-block:: powershell - - md \data\db - -You can specify an alternate path for data files -using the :option:`--dbpath ` option to -:program:`mongod.exe`, for example: - -.. code-block:: powershell - - C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data - -If your path includes spaces, enclose the entire path in double -quotes, for example: - -.. code-block:: powershell - - C:\mongodb\bin\mongod.exe --dbpath "d:\test\mongo db data" - -.. start-include-for-enterprise-tutorial - -Start MongoDB -~~~~~~~~~~~~~ - -To start MongoDB, execute from the :guilabel:`Command Prompt`: - -.. code-block:: powershell - - "C:\Program Files\MongoDB\bin\mongod.exe" - -This starts the main MongoDB database process. The ``waiting for -connections`` message in the console output indicates that the -mongod.exe process is running successfully. - -.. note:: - - Depending on the security level of your system, Windows may pop - up a :guilabel:`Security Alert` dialog box about blocking "some - features" of ``"C:\Program Files\MongoDB\bin\mongod.exe"`` from communicating - on networks. All users should select ``Private Networks, such - as my home or work network`` and click ``Allow access``. For - additional information on security and MongoDB, please read the - :doc:`/core/security` page. - .. warning:: - Do not make :program:`mongod.exe` visible on public networks - without running in "Secure Mode" with the :setting:`auth` setting. - MongoDB is designed to be run in trusted environments and the - database does not enable "Secure Mode" by default. - -To connect to MongoDB using the :program:`mongo.exe ` shell, -open a :guilabel:`Command Prompt` and issue the following command: - -.. code-block:: powershell - - C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data - -If your path includes spaces, enclose the entire path in double -quotes, for example: - -.. code-block:: powershell - - C:\mongodb\bin\mongod.exe --dbpath "d:\test\mongo db data" - -Connect to MongoDB -~~~~~~~~~~~~~~~~~~ + Do not make :program:`mongod.exe` visible on public networks without + running in "Secure Mode" with the :setting:`auth` setting. MongoDB is + designed to be run in trusted environments, and the database does not + enable "Secure Mode" by default. -Connect to MongoDB using the :program:`mongo.exe ` shell. Open another -:guilabel:`Command Prompt` and issue the following command: - -.. code-block:: powershell - - C:\mongodb\bin\mongo.exe -.. seealso:: :program:`mongo` and :doc:`/reference/method`. If - you want to develop applications using .NET, see the documentation - of :ecosystem:`C# and MongoDB ` for more - information. - -.. end-windows-operate-database +.. include:: /includes/steps/run-mongodb-on-windows.rst .. _tutorial-mongod-as-windows-service: Configure a Windows Service for MongoDB --------------------------------------- -.. start-configure-windows-service - -Set up MongoDB Enterprise Windows Server as a :guilabel:`Windows -Service` that starts automatically at boot time. - -Configure Directories and Files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Create a :doc:`configuration file ` -and a directory path for MongoDB log output (:setting:`logpath`): - -#. Create a specific directory for MongoDB log files: - - .. code-block:: powershell - - md "C:\Program Files\MongoDB\log" - -#. Create a configuration file for the :setting:`logpath` option for - MongoDB in the :guilabel:`Command Prompt`: - - .. code-block:: powershell - - echo logpath="C:\Program Files\MongoDB\log\mongo.log" > "C:\Program Files\MongoDB\mongod.cfg" - -Install and Run the MongoDB Service -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Run all of the following commands in :guilabel:`Command Prompt` with -"Administrative Privileges:" - -#. Install the MongoDB service: - - .. code-block:: powershell - - "C:\Program Files\MongoDB\bin\mongod.exe" --config "C:\Program Files\MongoDB\mongod.cfg" --install - -#. Modify the path to the ``mongod.cfg`` file as needed. - - .. important:: - - For :option:`--install ` to succeed, - you *must* specify the :setting:`logpath` run-time option. - -.. note:: - - To use an alternate :setting:`dbpath`, specify the path in the - configuration file (e.g. ``"C:\Program Files\MongoDB\mongod.cfg"``,) or use - :option:`--dbpath ` from the command line. - - If the :setting:`dbpath` directory does not exist, - :program:`mongod.exe` will not start. The default value for - :setting:`dbpath` is ``\data\db``. - -Stop or Remove the MongoDB Service -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To stop the MongoDB service use the following command: - -.. code-block:: powershell - - net stop MongoDB - -To remove the MongoDB service use the following command: - -.. code-block:: powershell - - "C:\Program Files\MongoDB\bin\mongod.exe" --remove +You can set up the MongoDB server as a :guilabel:`Windows Service` that +starts automatically at boot time. -.. end-configure-windows-service +.. include:: /includes/steps/configure-windows-service-for-mongodb.rst