diff --git a/source/includes/extracts-install-past-mongodb.yaml b/source/includes/extracts-install-past-mongodb.yaml index deb4afd5d79..e47dddc63c9 100644 --- a/source/includes/extracts-install-past-mongodb.yaml +++ b/source/includes/extracts-install-past-mongodb.yaml @@ -3,7 +3,8 @@ content: | .. note:: To install a different version of MongoDB, please refer to that - version's documentation. For example, see version {{installLink}}. + version's documentation. To install the previous version, see + the tutorial for version {{installLink}}. --- # Community diff --git a/source/includes/fact-default-bind-ip-change.rst b/source/includes/fact-default-bind-ip-change.rst index 6f0ae6ab499..424aacf4259 100644 --- a/source/includes/fact-default-bind-ip-change.rst +++ b/source/includes/fact-default-bind-ip-change.rst @@ -1,6 +1,7 @@ -Starting in MongoDB 3.6, MongoDB binaries, :binary:`~bin.mongod` and -:binary:`~bin.mongos`, bind to localhost by default. -Previously, starting in MongoDB 2.6, only the binaries from the +Starting with MongoDB 3.6, MongoDB binaries, :binary:`~bin.mongod` and +:binary:`~bin.mongos`, bind to ``localhost`` by default. +From MongoDB versions 2.6 to 3.4, only the binaries from the official MongoDB RPM (Red Hat, CentOS, Fedora Linux, and derivatives) -and DEB (Debian, Ubuntu, and derivatives) packages bind to localhost by -default. For more details, see :ref:`3.6-bind_ip-compatibility`. +and DEB (Debian, Ubuntu, and derivatives) packages would bind to +``localhost`` by default. To learn more about this change, see +:ref:`3.6-bind_ip-compatibility`. diff --git a/source/includes/fact-install-windows-prereq.rst b/source/includes/fact-install-windows-prereq.rst new file mode 100644 index 00000000000..9f1f69f2d83 --- /dev/null +++ b/source/includes/fact-install-windows-prereq.rst @@ -0,0 +1,68 @@ +Hardware Requirements +~~~~~~~~~~~~~~~~~~~~~ + +|mdb-edition| requires an x86 64-bit architecture. + +Software Requirements +~~~~~~~~~~~~~~~~~~~~~ + +Install on Windows 7 / Server 2008 R2 or Later + |mdb-edition| requires Microsoft Windows Server + 2008 R2 or later or Microsoft Windows 7 or later for the x86 64-bit + architecture. + + To find which version, service pack, and build of Windows is + running on your host, as well as the processor type of that host, + enter the following command in either the :guilabel:`Command Prompt` + or :guilabel:`Powershell`: + + .. code-block:: powershell + + systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" + + .. code-block:: powershell + :copyable: false + + OS Name: Microsoft Windows 10 Pro + OS Version: 10.0.17134 N/A Build 17134 + System Type: x64-based PC + +Show All File Name Extensions + Make certain that you set Windows Explorer to show file name + extensions for all file types. This can prevent issues where the + file type displayed to the user differs from the actual file type. + + .. example:: + + If Windows Explorer has known file extensions hidden, what may + appear to be ``mongod.cfg`` is actually ``mongod.cfg.txt``. + +Install all Windows Updates + Before installing MongoDB, update your Windows host with the latest + system updates. At minimum, ensure the following Windows updates + are installed on the host: + + - Windows 2012 Server and Windows 10 need + `KB2999226 `__ + to provide Universal C Runtime support for Windows. + + - Windows Server 2008 R2 and Windows 7 need + `KB2731284 `__ to resolve + an issue with memory mapped files on Windows. + +The Windows installer (``.msi``) file includes all other +software dependencies and automatically upgrades any previous version +of MongoDB in the :ref:`same release series ` +(3.4.1 to 3.4.2) that was installed using an ``.msi`` file. Upgrading +a full release series (3.4 to 3.6) requires a new installation. + +Security +~~~~~~~~ + +.. include:: /includes/fact-default-bind-ip-change.rst + +.. warning:: + + Do not expose :binary:`~bin.mongod.exe` to a public network without + :docs:`configuring authentication `. MongoDB + is designed to be run in trusted environments. diff --git a/source/includes/fact-install-windows.rst b/source/includes/fact-install-windows.rst index cfca21284ae..7fa8aaf930a 100644 --- a/source/includes/fact-install-windows.rst +++ b/source/includes/fact-install-windows.rst @@ -1,19 +1,20 @@ -In Windows Explorer, locate the downloaded MongoDB ``.msi`` file, which -typically is located in the default ``Downloads`` folder. Double-click -the ``.msi`` file. The Windows Installer guides you through the -installation process. +1. Open Windows Explorer. -You may specify an installation directory if you choose the -:guilabel:`Custom` installation option. +2. Change the directory path to where you downloaded the MongoDB + ``.msi`` file. By default, this is ``%HOMEPATH%\Downloads``. -.. note:: +3. Double-click the ``.msi`` file. - These instructions assume that you have installed MongoDB - to ``C:\Program Files\MongoDB\Server\{+version+}\``. +4. The Windows Installer guides you through the installation process. + + If you choose the :guilabel:`Custom` installation option, you may + specify an installation directory. + + MongoDB does not have any other system dependencies. You can install and run MongoDB from any folder you choose. + + .. note:: + + This tutorial assumes that you installed MongoDB + in ``C:\Program Files\MongoDB\Server\{+version+}\``. -During the installation process you will be given the option to install -:ref:`MongoDB Compass ` in addition to MongoDB Server. -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/release-base.yaml b/source/includes/release-base.yaml index 5d7ef3b593e..81ae1972ccb 100644 --- a/source/includes/release-base.yaml +++ b/source/includes/release-base.yaml @@ -12,24 +12,94 @@ code: | --- ref: _install-windows copyable: true -language: powershell +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi +--- +ref: _install-windows-nocompass +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ + SHOULD_INSTALL_COMPASS="0" +--- +ref: _install-windows-ent +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-enterprise-windows-64-{{version}}-signed.msi +--- +ref: _install-windows-ent-nocompass +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-enterprise-windows-64-{{version}}-signed.msi ^ + SHOULD_INSTALL_COMPASS="0" +--- +ref: _install-windows-custom-location +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ + INSTALLLOCATION="{{location}}" +--- +ref: _install-windows-custom-location-nocompass +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ + INSTALLLOCATION="{{location}}" ^ + SHOULD_INSTALL_COMPASS="0" +--- +ref: _install-windows-ent-custom-location +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-enterprise-windows-64-{{version}}-signed.msi ^ + INSTALLLOCATION="{{location}}" +--- +ref: _install-windows-specify-local +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ + ADDLOCAL="{{addlocal}}" +--- +ref: _install-windows-specify-local-nocompass +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ + ADDLOCAL="{{addlocal}}" ^ + SHOULD_INSTALL_COMPASS="0" +--- +ref: _install-windows-ent-specify-local +copyable: true +language: bat +code: | + msiexec.exe /q /i mongodb-win32-x86_64-enterprise-windows-64-{{version}}-signed.msi ^ + ADDLOCAL="{{addlocal}}" +--- +ref: _install-windows-custom-location-specify-local +copyable: true +language: bat code: | msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ INSTALLLOCATION="{{location}}" ^ ADDLOCAL="{{addlocal}}" --- -ref: _install-windows-nocompass +ref: _install-windows-custom-location-specify-local-nocompass copyable: true -language: powershell +language: bat code: | msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-{{version}}-signed.msi ^ INSTALLLOCATION="{{location}}" ^ ADDLOCAL="{{addlocal}}" ^ SHOULD_INSTALL_COMPASS="0" --- -ref: _install-windows-ent +ref: _install-windows-ent-custom-location-specify-local copyable: true -language: powershell +language: bat code: | msiexec.exe /q /i mongodb-win32-x86_64-enterprise-windows-64-{{version}}-signed.msi ^ INSTALLLOCATION="{{location}}" ^ diff --git a/source/includes/release-specifications.yaml b/source/includes/release-specifications.yaml index 4d8af828a1e..6bb5bc04c79 100644 --- a/source/includes/release-specifications.yaml +++ b/source/includes/release-specifications.yaml @@ -33,11 +33,18 @@ replacement: ref: install-windows-addlocal source: file: release-base.yaml - ref: _install-windows + ref: _install-windows-specify-local replacement: location: 'C:\Program Files\MongoDB\Server\{+version+}\' addlocal: 'MonitoringTools,ImportExportTools,MiscellaneousTools' --- +ref: install-windows-addlocation +source: + file: release-base.yaml + ref: _install-windows-custom-location +replacement: + location: 'C:\MongoDB\Server\{+version+}\' +--- ref: install-ent-windows-default source: file: release-base.yaml @@ -49,8 +56,22 @@ replacement: ref: install-ent-windows-addlocal source: file: release-base.yaml - ref: _install-windows-ent + ref: _install-windows-ent-specify-local replacement: location: 'C:\Program Files\MongoDB\Server\{+version+}\' addlocal: 'MonitoringTools,ImportExportTools,MiscellaneousTools' +--- +ref: install-ent-windows-addlocation +source: + file: release-base.yaml + ref: _install-windows-ent-custom-location +replacement: + location: 'C:\MongoDB\Server\{+version+}\' +--- +ref: install-ent-windows-nocompass +source: + file: release-base.yaml + ref: _install-windows-ent-nocompass +replacement: + location: 'C:\Program Files\MongoDB\Server\{+version+}\' ... diff --git a/source/includes/steps-configure-windows-service-for-mongodb.yaml b/source/includes/steps-configure-windows-service-for-mongodb.yaml index 482269a2206..0fe6eb6de3d 100644 --- a/source/includes/steps-configure-windows-service-for-mongodb.yaml +++ b/source/includes/steps-configure-windows-service-for-mongodb.yaml @@ -1,55 +1,59 @@ stepnum: 1 +level: 4 inherit: - file: steps-create-manually-windows-service-for-mongodb.yaml - ref: open-command-prompt ---- -stepnum: 2 -inherit: - file: steps-create-manually-windows-service-for-mongodb.yaml + file: steps-run-mongodb-on-windows.yaml ref: create-directories +pre: | + + If you have not created the data and log directories for your + MongoDB server, you must create them before running |mdb-edition| as + a Windows service. --- -stepnum: 3 +stepnum: 2 +level: 4 inherit: file: steps-create-manually-windows-service-for-mongodb.yaml ref: create-configuration-file --- title: Install the MongoDB service. -stepnum: 4 +stepnum: 3 +level: 4 ref: mongodb-service -pre: | - .. important:: +content: | - Run all of the following commands in :guilabel:`Command Prompt` with - "Administrative Privileges". -action: - - pre: | - Install the MongoDB service by starting :binary:`~bin.mongod.exe` - with the ``--install`` option and the ``-config`` - option to specify the previously created configuration file. - language: powershell - copyable: true - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" ^ + Install the MongoDB service by starting :binary:`~bin.mongod.exe` + with the ``--install`` option and the ``-config`` + option to specify the previously created configuration file. + + .. code-block:: + + "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" ^ --config "C:\Program Files\MongoDB\Server\{+version+}\mongod.cfg" ^ --install -post: | + To use an alternate :setting:`dbpath`, specify the path in the configuration file (e.g. ``C:\mongodb\mongod.cfg``) or - on the command line with the :option:`--dbpath ` option. + on the command line with the :option:`--dbpath ` + option. + + .. note:: - If needed, you can install services for multiple instances of - :binary:`~bin.mongod.exe` or :binary:`~bin.mongos.exe`. Install each service - with a unique :option:`--serviceName ` and - :option:`--serviceDisplayName `. Use - multiple instances only when sufficient system resources exist and your - system design requires it. + You can install services for multiple instances of + :binary:`~bin.mongod.exe` or :binary:`~bin.mongos.exe` on a + single host. Install each service with a unique + :option:`--serviceName ` and + :option:`--serviceDisplayName `. + Use multiple instances only when sufficient system resources + exist and your system design requires it. --- -stepnum: 5 +stepnum: 4 +level: 4 inherit: file: steps-create-manually-windows-service-for-mongodb.yaml ref: start-mongodb-service --- -stepnum: 6 +stepnum: 5 +level: 4 source: file: steps-run-mongodb-on-linux.yaml ref: verify @@ -66,11 +70,12 @@ post: | ignore these warnings during your initial evaluation of MongoDB. --- title: Connect to MongoDB. -stepnum: 7 +stepnum: 6 +level: 4 ref: connect pre: | - To connect to MongoDB through the :binary:`mongo.exe ` shell, - open another :guilabel:`Command Prompt`. + To connect to MongoDB through the :binary:`mongo.exe ` + shell, open another :guilabel:`Command Prompt`. action: copyable: true language: powershell @@ -80,8 +85,9 @@ post: | If you want to develop applications using .NET, see the documentation of :ecosystem:`C# and MongoDB ` for more information. --- -title: Stop or remove the MongoDB service as needed. -stepnum: 8 +title: Stop or remove the MongoDB service. +stepnum: 7 +level: 4 ref: stop action: - pre: | diff --git a/source/includes/steps-create-manually-windows-service-for-mongodb.yaml b/source/includes/steps-create-manually-windows-service-for-mongodb.yaml index c6683a56bee..3cfd619fb05 100644 --- a/source/includes/steps-create-manually-windows-service-for-mongodb.yaml +++ b/source/includes/steps-create-manually-windows-service-for-mongodb.yaml @@ -1,32 +1,24 @@ -title: - text: Open an Administrator command prompt. - character: "~" stepnum: 1 -ref: open-command-prompt +level: 4 +inherit: + file: steps-run-mongodb-on-windows.yaml + ref: create-directories pre: | - Press the ``Win`` key, type ``cmd.exe``, and press ``Ctrl + Shift + Enter`` - to run the :guilabel:`Command Prompt` as Administrator. -post: | - Execute the remaining steps from the Administrator command prompt. ---- -title: Create directories. -stepnum: 2 -ref: create-directories -pre: | - Create directories for your database and log files: -action: - language: powershell - copyable: true - code: | - mkdir c:\data\db - mkdir c:\data\log + + If you have not created the data and log directories for your + MongoDB server, you must create them before running |mdb-edition| as + a Windows service. --- title: Create a MongoDB configuration file. -stepnum: 3 +stepnum: 2 ref: create-configuration-file content: | Using your preferred text editor, create a MongoDB configuration - file. + file. The default location and filename are: + + .. code-block:: bat + + C:\Program Files\MongoDB\Server\{+version+}\mongod.cfg .. note:: MongoDB configuration files use the @@ -55,79 +47,62 @@ content: | dbPath: "c:\\data\\db" --- title: Create the MongoDB service. -stepnum: 4 +stepnum: 3 ref: create-mongodb-service -action: - - pre: "Create the MongoDB service." - language: powershell - copyable: true - code: | - sc.exe create MongoDB ^ - binPath= "\"C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe\" ^ - --service --config=\"C:\Program Files\MongoDB\Server\{+version+}\mongod.cfg\"" ^ - DisplayName= "MongoDB" start= "auto" - post: | - ``sc.exe`` requires a space between "=" and the configuration values - (eg "binPath= "), and a "\\" to escape double quotes. - - pre: "If successfully created, the following log message will display:" - language: powershell - code: | +content: | + + Invoke the following command in the :guilabel:`Command Interpreter` + to create the service: + + .. code-block:: bat + + sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe\" ^ + --service --config=\"C:\Program Files\MongoDB\Server\{+version+}\mongod.cfg\""DisplayName= "MongoDB" start= "auto" + + .. note:: + ``sc.exe`` requires a space between "``=`` " and the + configuration values (i.e. ``binPath= `` ) as well as using + `` "\"`` and ``\""`` to escape a double-quoted string. + + If successfully created, the following message is written to the + log: + + .. code-block:: bat + :copyable: false + [SC] CreateService SUCCESS --- title: Start the MongoDB service. -stepnum: 5 +stepnum: 4 ref: start-mongodb-service -action: - pre: | - Close all other command prompts, then invoke the following command: - language: powershell - copyable: true - code: | - net start MongoDB +content: | + Close all other command prompts, then invoke the following command: + + .. code-block:: bat + + net start MongoDB --- -stepnum: 6 +stepnum: 5 source: file: steps-run-mongodb-on-linux.yaml ref: verify pre: | - Verify that MongoDB has started successfully by checking the - log file at ``c:\data\log\mongod.log`` for the following line: + Check your MongoDB log file for the following line: post: | - If you modified the :setting:`systemLog.path` - configuration file option, open the log file at that location to - examine the process output. - You may see non-critical warnings in the process - output. As long as you see the log line shown above, you can safely - ignore these warnings during your initial evaluation of MongoDB. + output. As long as you see this message in the MongoDB log, you can + safely ignore these warnings during your initial evaluation of + MongoDB. --- -title: Connect to MongoDB. -stepnum: 7 +title: Connect to the MongoDB server. +stepnum: 6 ref: connect -pre: | - To connect to MongoDB through the :binary:`~bin.mongo.exe ` shell, - open another :guilabel:`Command Prompt`. -action: - copyable: true - language: powershell - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongo.exe" -post: | - If you want to develop applications using .NET, see the documentation - of :ecosystem:`C# and MongoDB ` for more information. ---- -title: Stop or remove the MongoDB service as needed. -stepnum: 8 -ref: stop-mongodb-service -action: - - pre: "To stop the MongoDB service, use the following command:" - language: powershell - code: | - net stop MongoDB - - pre: | - To remove the MongoDB service, first stop the service and then - run the following command: - language: powershell - code: | - sc.exe delete MongoDB +content: | + To connect to MongoDB through the :binary:`mongo.exe ` + shell, open another :guilabel:`Command Interpreter`. + + .. code-block:: bat + + "C:\Program Files\MongoDB\Server\{+version+}\bin\mongo.exe" + ... diff --git a/source/includes/steps-install-mongodb-enterprise-on-windows-unattended.yaml b/source/includes/steps-install-mongodb-enterprise-on-windows-unattended.yaml index 3dd419677ab..a2208e1a7ee 100644 --- a/source/includes/steps-install-mongodb-enterprise-on-windows-unattended.yaml +++ b/source/includes/steps-install-mongodb-enterprise-on-windows-unattended.yaml @@ -1,8 +1,18 @@ +title: "Download |mdb-edition|." stepnum: 1 level: 4 -inherit: - file: steps-create-manually-windows-service-for-mongodb.yaml - ref: open-command-prompt +ref: download-mongodb +content: | + a. Open a web browser and visit the |mdb-download-link|. + + #. The Download Center should display the + :guilabel:`Release`. From the :guilabel:`Platforms` menu, click + :guilabel:`Windows x64`. + + #. Click :guilabel:`Download`. + + #. When the :guilabel:`Install MongoDB Enterprise` modal appears, + click the :guilabel:`msi` link. --- stepnum: 2 level: 4 @@ -12,4 +22,6 @@ inherit: replacement: release_specification_default: "/includes/release/install-ent-windows-default.rst" release_specification_addlocal: "/includes/release/install-ent-windows-addlocal.rst" + release_specification_addlocation: "/includes/release/install-ent-windows-addlocation.rst" + release_specification_nocompass: "/includes/release/install-ent-windows-nocompass.rst" ... diff --git a/source/includes/steps-install-mongodb-on-windows-enterprise-interactive.yaml b/source/includes/steps-install-mongodb-on-windows-enterprise-interactive.yaml new file mode 100644 index 00000000000..b749e133928 --- /dev/null +++ b/source/includes/steps-install-mongodb-on-windows-enterprise-interactive.yaml @@ -0,0 +1,39 @@ +title: "Download |mdb-edition|." +stepnum: 1 +level: 4 +ref: download-mongodb +content: | + a. Open a web browser and visit the |mdb-download-link|. + + #. The Download Center should display the + :guilabel:`Release`. From the :guilabel:`Platforms` menu, click + :guilabel:`Windows x64`. + + #. Click :guilabel:`Download`. + + #. When the :guilabel:`Install MongoDB Enterprise` modal appears, + click the :guilabel:`msi` link. +--- +title: "Open Windows Explorer." +stepnum: 2 +level: 4 +ref: open-windows-explorer +--- +title: "Navigate to the directory in which you downloaded the MongoDB installer." +stepnum: 3 +inherit: + file: steps-install-mongodb-on-windows-interactive.yaml + ref: change-to-download-directory +--- +title: "Double-click the ``.msi`` file." +stepnum: 4 +level: 4 +ref: run-windows-installer +--- +title: "Follow the |mdb-edition| installation wizard." +stepnum: 5 +level: 4 +inherit: + file: steps-install-mongodb-on-windows-interactive.yaml + ref: follow-install-wizard +... diff --git a/source/includes/steps-install-mongodb-on-windows-interactive.yaml b/source/includes/steps-install-mongodb-on-windows-interactive.yaml new file mode 100644 index 00000000000..4ae4c0a4e9b --- /dev/null +++ b/source/includes/steps-install-mongodb-on-windows-interactive.yaml @@ -0,0 +1,43 @@ +title: "Download |mdb-edition|." +stepnum: 1 +level: 4 +ref: download-mongodb +content: | + a. Open a web browser and visit the |mdb-download-link|. + + #. The Download Center should display the + :guilabel:`Current Stable Release` and have the :icon:`windows` + :guilabel:`Windows` tab selected. If that tab is not selected, + click that tab. + + #. Click :guilabel:`Download (msi)`. +--- +title: "Open Windows Explorer." +stepnum: 2 +level: 4 +ref: open-windows-explorer +--- +title: "Navigate to the directory in which you downloaded the MongoDB installer." +stepnum: 3 +level: 4 +ref: change-to-download-directory +content: | + Change the directory path to where you downloaded the MongoDB + ``.msi`` file. By default, this is ``%HOMEPATH%\Downloads``. + +--- +title: "Double-click the ``.msi`` file." +stepnum: 4 +level: 4 +ref: run-windows-installer +--- +title: "Follow the |mdb-edition| installation wizard." +stepnum: 5 +level: 4 +ref: follow-install-wizard +content: | + If you choose the :guilabel:`Custom` installation option, you may + specify an installation directory. MongoDB has no other system + dependencies. You can install and run MongoDB from any directory. + +... diff --git a/source/includes/steps-install-mongodb-on-windows-unattended.yaml b/source/includes/steps-install-mongodb-on-windows-unattended.yaml index 667d93bcefb..202f79db023 100644 --- a/source/includes/steps-install-mongodb-on-windows-unattended.yaml +++ b/source/includes/steps-install-mongodb-on-windows-unattended.yaml @@ -1,26 +1,36 @@ +title: "Download |mdb-edition|." stepnum: 1 level: 4 -inherit: - file: steps-create-manually-windows-service-for-mongodb.yaml - ref: open-command-prompt +ref: download-mongodb +content: | + a. Open a web browser and visit the |mdb-download-link|. + + #. The Download Center should display the + :guilabel:`Current Stable Release` and have the :icon:`windows` + :guilabel:`Windows` tab selected. If that tab is not selected, + click that tab. + + #. Click :guilabel:`Download (msi)`. --- -title: Install MongoDB for Windows. +title: Run the Windows Installer from the Windows Command Interpreter. stepnum: 2 level: 4 ref: install pre: | - Change to the directory containing the ``.msi`` installation binary of your - choice and invoke: + Change to the directory containing the ``.msi`` installation binary + and invoke: .. include:: {{release_specification_default}} - You can specify the installation location for the executable by - modifying the ``INSTALLLOCATION`` value. + To specify a different installation location for the executables, + add the ``INSTALLLOCATION`` value. - By default, this method installs all MongoDB binaries. To install specific - MongoDB component sets, you can specify them in the ``ADDLOCAL`` argument - using a comma-separated list including one or more of the following - component sets: + .. include:: {{release_specification_addlocation}} + + By default, this method installs all MongoDB binaries. To install + specific MongoDB component sets, you can specify them in the + ``ADDLOCAL`` argument using a comma-separated list including one or + more of the following component sets: .. list-table:: :header-rows: 1 @@ -41,11 +51,14 @@ pre: | * - ``MiscellaneousTools`` - ``bsondump.exe``, ``mongofiles.exe`` - For instance, to install *only* the MongoDB utilities, invoke: + .. example:: + + To install *only* the MongoDB utilities, invoke: - .. include:: {{release_specification_addlocal}} + .. include:: {{release_specification_addlocal}} - If you do NOT wish to install :ref:`MongoDB Compass ` + If you do *not* wish to install + :ref:`MongoDB Compass ` at this time, include the ``SHOULD_INSTALL_COMPASS="0"`` argument. .. include:: {{release_specification_nocompass}} @@ -53,4 +66,5 @@ pre: | replacement: release_specification_default: "/includes/release/install-windows-default.rst" release_specification_addlocal: "/includes/release/install-windows-addlocal.rst" + release_specification_addlocation: "/includes/release/install-windows-addlocation.rst" release_specification_nocompass: "/includes/release/install-windows-nocompass.rst" diff --git a/source/includes/steps-run-mongodb-on-linux.yaml b/source/includes/steps-run-mongodb-on-linux.yaml index 93ebcb978bf..4ad26f1385a 100644 --- a/source/includes/steps-run-mongodb-on-linux.yaml +++ b/source/includes/steps-run-mongodb-on-linux.yaml @@ -58,7 +58,7 @@ action: mongod --dbpath # End-for-getting-started-guide --- -title: Verify that MongoDB has started successfully +title: "Verify that MongoDB has started successfully." stepnum: 4 ref: verify pre: | @@ -66,6 +66,7 @@ pre: | checking the process output for the following line: action: language: none + copyable: false code: | [initandlisten] waiting for connections on port 27017 post: | diff --git a/source/includes/steps-run-mongodb-on-windows.yaml b/source/includes/steps-run-mongodb-on-windows.yaml index a7cf9b67bc3..bd7f359922d 100644 --- a/source/includes/steps-run-mongodb-on-windows.yaml +++ b/source/includes/steps-run-mongodb-on-windows.yaml @@ -1,78 +1,86 @@ -title: Set up the MongoDB environment. +title: "Create database and log directories." 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 the absolute path - ``\data\db`` on the drive from which you start MongoDB. Create - this folder by running the following command in a - :guilabel:`Command Prompt`: - copyable: true - language: powershell - code: | - md \data\db - - pre: | - You can specify an alternate path for data files using the - :option:`--dbpath ` option to - :binary:`~bin.mongod.exe`, for example: - copyable: true - language: powershell - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" --dbpath d:\test\mongodb\data - - pre: | - If your path includes spaces, enclose the entire path in double - quotes, for example: - copyable: true - language: powershell - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" --dbpath "d:\test\mongo db data" -post: | - You may also specify the ``dbpath`` in a :doc:`configuration file - `. +ref: create-directories +content: | + + MongoDB requires a :term:`data directory ` to store all + data. MongoDB's default data directory path is the absolute path + ``\data\db`` on the drive from which you start MongoDB. + + Invoke the following command in the :guilabel:`Command Interpreter` + to create these directories: + + .. code-block:: bat + + md "\data\db" "\data\log" + + .. note:: + The quotations marks matter when creating more than one directory + path at the same time. + --- -title: Start MongoDB. +title: Start your MongoDB database. stepnum: 2 ref: start -action: - pre: | - To start MongoDB, run :binary:`~bin.mongod.exe`. For example, from the - :guilabel:`Command Prompt`: - copyable: true - language: powershell - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" -post: | - This starts the main MongoDB database process. The ``waiting for - connections`` message in the console output indicates that the - :binary:`~bin.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\Server\{+version+}\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 see the :doc:`Security Documentation `. ---- -title: Verify that MongoDB has started successfully -stepnum: 3 -source: - file: steps-run-mongodb-on-linux.yaml - ref: verify +content: | + + To start MongoDB, invoke :binary:`~bin.mongod.exe`. + + .. example:: + + From the :guilabel:`Command Interpreter`: + + .. code-block:: bat + + "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" --dbpath="c:\data\db" + + The :option:`--dbpath ` option points to your + database directory. + + .. note:: + + If your path includes spaces, enclose the entire path in double + quotes: + + .. code-block:: bat + + "C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe" --dbpath "d:\test\mongo db data" + + If the MongoDB database server is running correctly, the + :guilabel:`Command Interpreter` displays: + + .. code-block:: shell + + [initandlisten] waiting for connections + + .. important:: + + Depending on the + `Windows Defender Firewall `__ + settings on your Windows host, Windows may display a + :guilabel:`Security Alert` dialog box about blocking + "some features" of ``C:\Program Files\MongoDB\Server\{+version+}\bin\mongod.exe`` + from communicating on networks. To remedy this issue: + + a. Click :guilabel:`Private Networks, such as my home or work + network`. + b. Click :guilabel:`Allow access`. + + To learn more about security and MongoDB, see the + :doc:`Security Documentation `. --- title: Connect to MongoDB. -stepnum: 4 +stepnum: 3 ref: connect -pre: | - To connect to MongoDB through the :binary:`~bin.mongo.exe ` shell, - open another :guilabel:`Command Prompt`. -action: - copyable: true - language: powershell - code: | - "C:\Program Files\MongoDB\Server\{+version+}\bin\mongo.exe" -post: | - If you want to develop applications using .NET, see the documentation - of :ecosystem:`C# and MongoDB ` for more information. +content: | + To connect to MongoDB through the + :binary:`mongo.exe ` shell, open another + :guilabel:`Command Interpreter`. + + .. code-block:: bat + + "C:\Program Files\MongoDB\Server\{+version+}\bin\mongo.exe" + + # End-for-getting-started-guide -... \ No newline at end of file +... diff --git a/source/tutorial/install-mongodb-enterprise-on-windows.txt b/source/tutorial/install-mongodb-enterprise-on-windows.txt index 4ecf829570d..b107d2c0d2d 100644 --- a/source/tutorial/install-mongodb-enterprise-on-windows.txt +++ b/source/tutorial/install-mongodb-enterprise-on-windows.txt @@ -1,6 +1,6 @@ -===================================== -Install MongoDB Enterprise on Windows -===================================== +============================================= +Install MongoDB Enterprise Edition on Windows +============================================= .. default-domain:: mongodb @@ -10,90 +10,108 @@ Install MongoDB Enterprise on Windows :depth: 1 :class: singlecol -.. versionadded:: 2.6 +.. |mdb-edition| replace:: MongoDB Enterprise Edition +.. |mdb-download-link| replace:: `MongoDB Download Center `__ -Overview --------- +Use this tutorial to install |mdb-edition| {+version+} +on Windows hosts. -Use this tutorial to install :products:`MongoDB Enterprise -` on Windows -systems. MongoDB Enterprise is available on select platforms and contains -support for several features related to security and monitoring. +.. include:: /includes/extracts/install-past-mongodb-enterprise-windows.rst -.. note:: +System Requirements +------------------- - .. include:: /includes/fact-default-bind-ip-change.rst +.. include:: /includes/fact-install-windows-prereq.rst -Prerequisites -------------- +Considerations +-------------- -MongoDB Enterprise Server for Windows requires Windows Server 2008 R2 or -later. The ``.msi`` installer includes all other software dependencies and will -automatically upgrade any older version of MongoDB installed using an ``.msi`` -file. +Use Command Interpreter, not Powershell +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To find which version of Windows you are running, enter the following -commands in the :guilabel:`Command Prompt` or :guilabel:`Powershell`: +Every time this tutorial refers to the command line, you should use +the `Windows command interpreter `__ (``cmd.exe``) +with Administrative privileges. Not all commands work in Powershell. -.. code-block:: powershell +To start ``cmd.exe`` with Administrative privileges: - wmic os get caption - wmic os get osarchitecture +1. `Open the Start menu `__. + - Press the :icon:`windows` key. + - Click on the :guilabel:`Start` :icon:`windows` icon at the left + end of the taskbar. +#. Type ``cmd.exe`` in the search box. +#. Press **Ctrl** + **Shift** + **Enter**. -Get MongoDB Enterprise ----------------------- + This starts the :guilabel:`Command Prompt` as the + **Administrator** user. -.. include:: /includes/extracts/install-past-mongodb-enterprise-windows.rst +Add MongoDB binaries to the System PATH +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Download the latest production release of MongoDB Enterprise from the -`MongoDB Download Center -`_. +All command-line examples in this tutorial are provided as absolute paths to the MongoDB binaries. You can add ``C:\Program Files\MongoDB\Server\{+version+}\bin`` to your System ``PATH`` and then omit the full path to the MongoDB binaries. -Install MongoDB Enterprise --------------------------- +Remember the directory where you installed MongoDB +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Interactive Installation -~~~~~~~~~~~~~~~~~~~~~~~~ +This tutorial uses the default |mdb-edition| location of +``C:\Program Files\MongoDB\Server\{+version+}\``. -.. include:: /includes/fact-install-windows.rst +If you have installed in an alternative directory, you must +adjust the paths as appropriate. -Unattended Installation -~~~~~~~~~~~~~~~~~~~~~~~ +Install |mdb-edition| +--------------------- -You may install MongoDB unattended on Windows from the command line -using ``msiexec.exe``. +.. tabs:: -.. include:: /includes/steps/install-mongodb-enterprise-on-windows-unattended.rst + tabs: + - id: interactive + name: Interactive Installation + content: | -Run MongoDB Enterprise ----------------------- + You may install |mdb-edition| using the Windows Installer and + following its wizard. -.. warning:: + .. include:: /includes/steps/install-mongodb-on-windows-enterprise-interactive.rst - Do not make :binary:`~bin.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. + - id: unattended + name: Unattended Installation + content: | + You may install |mdb-edition| unattended on Windows + from the command line using ``msiexec.exe``. -.. include:: /includes/steps/run-mongodb-on-windows.rst + .. include:: /includes/steps/install-mongodb-enterprise-on-windows-unattended.rst -Configure a Windows Service for MongoDB Enterprise --------------------------------------------------- +Start |mdb-edition| from the Command Interpreter +------------------------------------------------ -.. include:: /includes/steps/configure-windows-service-for-mongodb.rst +.. include:: /includes/steps/run-mongodb-on-windows.rst .. _manually-create-windows-service-enterprise: -Manually Create a Windows Service for MongoDB Enterprise --------------------------------------------------------- +Start |mdb-edition| as a Windows Service +---------------------------------------- You can set up the MongoDB server as a :guilabel:`Windows Service` that starts automatically at boot time. -The following procedure assumes you have installed MongoDB using the -``.msi`` installer with the path ``C:\Program Files\MongoDB\Server\3.6\``. +.. include:: /includes/steps/create-manually-windows-service-for-mongodb.rst -If you have installed in an alternative directory, you will need to -adjust the paths as appropriate. +Stop |mdb-edition| as a Windows Service +---------------------------------------- -.. include:: /includes/steps/create-manually-windows-service-for-mongodb.rst +To stop the MongoDB service, invoke the following command: + +.. code-block:: bat + + net stop MongoDB + +Remove |mdb-edition| as a Windows Service +------------------------------------------ + +To remove the MongoDB service, first stop the service and then +run the following command: + +.. code-block:: bat + + sc.exe delete MongoDB diff --git a/source/tutorial/install-mongodb-on-windows.txt b/source/tutorial/install-mongodb-on-windows.txt index 1199ed62246..0c25bf30a0e 100644 --- a/source/tutorial/install-mongodb-on-windows.txt +++ b/source/tutorial/install-mongodb-on-windows.txt @@ -10,117 +10,108 @@ Install MongoDB Community Edition on Windows :depth: 1 :class: singlecol -Overview --------- +.. |mdb-edition| replace:: MongoDB Community Edition +.. |mdb-download-link| replace:: `MongoDB Download Center `__ -Use this tutorial to install MongoDB Community Edition on Windows systems. +Use this tutorial to install |mdb-edition| {+version+} +on Windows hosts. -.. note:: - - .. include:: /includes/fact-default-bind-ip-change.rst +.. include:: /includes/extracts/install-past-mongodb-org-windows.rst System Requirements ------------------- -MongoDB Community Edition requires Microsoft Windows Server 2008 R2 or -later or Microsoft Windows 7 or later on an x86 64-bit architecture. -The Windows installer (``.msi``) file includes all other -software dependencies and automatically upgrades any previous version -of MongoDB that was installed using an ``.msi`` file. - -To find which version, service pack, and build of Windows is -running on your host, as well as the processor type of that host, -enter the following command in either the :guilabel:`Command Prompt` or -:guilabel:`Powershell`: +.. include:: /includes/fact-install-windows-prereq.rst -.. code-block:: powershell +Considerations +-------------- - PS C:\> systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" +Use Command Interpreter, not Powershell +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: powershell - :copyable: false +Every time this tutorial refers to the command line, you should use +the `Windows command interpreter `__ (``cmd.exe``) +with Administrative privileges. Not all commands work in Powershell. - OS Name: Microsoft Windows 10 Pro - OS Version: 10.0.17134 N/A Build 17134 - System Type: x64-based PC +To start ``cmd.exe`` with Administrative privileges: -Make certain that you set Windows Explorer to show file name -extensions for all file types. This can prevent issues where the file -type displayed to the user differs from the actual file type. +1. `Open the Start menu `__. + - Press the :icon:`windows` key. + - Click on the :guilabel:`Start` :icon:`windows` icon at the left + end of the taskbar. +#. Type ``cmd.exe`` in the search box. +#. Press **Ctrl** + **Shift** + **Enter**. -.. example:: + This starts the :guilabel:`Command Prompt` as the + **Administrator** user. - If Windows Explorer has known file extensions hidden, what may - appear to be ``mongod.cfg`` is actually ``mongod.cfg.txt``. +Add MongoDB binaries to the System PATH +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. important:: +All command-line examples in this tutorial are provided as absolute paths to the MongoDB binaries. You can add ``C:\Program Files\MongoDB\Server\{+version+}\bin`` to your System ``PATH`` and then omit the full path to the MongoDB binaries. - Before installing MongoDB, update your Windows host with the latest - system updates. At minimum, ensure the following Windows updates - are installed on the host: +Remember the directory where you installed MongoDB +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Windows 2012 Server and Windows 10 need - `KB2999226 `__ - to provide Universal C Runtime support for Windows. - - - Windows Server 2008 R2 and Windows 7 need - `KB2731284 `__ to resolve - an issue with memory mapped files on Windows. +This tutorial uses the default |mdb-edition| location of +``C:\Program Files\MongoDB\Server\{+version+}\``. -Get MongoDB Community Edition ------------------------------ +If you have installed in an alternative directory, you must +adjust the paths as appropriate. -.. include:: /includes/extracts/install-past-mongodb-org-windows.rst +Install |mdb-edition| +--------------------- -Download the latest production release of MongoDB from the `MongoDB -Download Center `_. +.. tabs:: -Install MongoDB Community Edition ---------------------------------- + tabs: + - id: interactive + name: Interactive Installation + content: | -Interactive Installation -~~~~~~~~~~~~~~~~~~~~~~~~ + You may install |mdb-edition| using the Windows Installer and + following its wizard. -.. include:: /includes/fact-install-windows.rst + .. include:: /includes/steps/install-mongodb-on-windows-interactive.rst -Unattended Installation -~~~~~~~~~~~~~~~~~~~~~~~ + - id: unattended + name: Unattended Installation + content: | + You may install MongoDB |mdb-edition| unattended on Windows + from the command line using ``msiexec.exe``. -You may install MongoDB Community unattended on Windows from the command line -using ``msiexec.exe``. + .. include:: /includes/steps/install-mongodb-on-windows-unattended.rst -.. include:: /includes/steps/install-mongodb-on-windows-unattended.rst +Start |mdb-edition| from the Command Interpreter +------------------------------------------------ -Run MongoDB Community Edition ------------------------------ +.. include:: /includes/steps/run-mongodb-on-windows.rst -.. warning:: +.. _manually-create-windows-service: - Do not make :binary:`~bin.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. +Start |mdb-edition| as a Windows Service +---------------------------------------- -.. include:: /includes/steps/run-mongodb-on-windows.rst +You can set up the MongoDB server as a :guilabel:`Windows Service` that +starts automatically at boot time. -.. _manually-create-windows-service: +.. include:: /includes/steps/create-manually-windows-service-for-mongodb.rst -Configure a Windows Service for MongoDB Community Edition ---------------------------------------------------------- +Stop |mdb-edition| as a Windows Service +---------------------------------------- -.. include:: /includes/steps/configure-windows-service-for-mongodb.rst +To stop the MongoDB service, invoke the following command: + +.. code-block:: bat -Manually Create a Windows Service for MongoDB Community Edition ---------------------------------------------------------------- + net stop MongoDB -You can set up the MongoDB server as a :guilabel:`Windows Service` that -starts automatically at boot time. +Remove |mdb-edition| as a Windows Service +------------------------------------------ -The following procedure assumes you have installed MongoDB Community -using the ``.msi`` installer with the path -``C:\Program Files\MongoDB\Server\{+version+}\``. +To remove the MongoDB service, first stop the service and then +run the following command: -If you have installed in an alternative directory, you must -adjust the paths as appropriate. +.. code-block:: bat -.. include:: /includes/steps/create-manually-windows-service-for-mongodb.rst + sc.exe delete MongoDB