Skip to content

DOCS-5501: Bring back Windows service configuration instructions #2323

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions source/includes/steps-configure-windows-service-for-mongodb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
stepnum: 1
inherit:
file: steps-create-manually-windows-service-for-mongodb.yaml
ref: open-command-prompt
---
title: Configure directories and files.
stepnum: 2
ref: directories
pre: |
Create a :doc:`configuration file </reference/configuration-options>`
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:\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:\mongodb\log\mongo.log > "C:\mongodb\mongod.cfg"
---
title: Run the MongoDB service.
stepnum: 3
ref: mongodb-service
pre: |
.. important::

Run all of the following commands in :guilabel:`Command Prompt` with
"Administrative Privileges:"
action:
- pre: |
Install the MongoDB service. For :option:`--install <mongod.exe
--install>` to succeed, you *must* specify the :setting:`logpath`
run-time option.
language: powershell
code: |
"C:\mongodb\bin\mongod.exe" --config "C:\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:\mongodb\mongod.cfg``) or
on the command line with the :option:`--dbpath <mongod --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``.

If needed, you can install services for multiple instances of
:program:`mongod.exe` or :program:`mongos.exe`. Install each service
with a unique :option:`--serviceName <mongod.exe --serviceName>` and
:option:`--serviceDisplayName <mongod.exe --serviceDisplayName>`. Use
multiple instances only when sufficient system resources exist and your
system design requires it.
---
title: Stop or remove the MongoDB service as needed.
stepnum: 4
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:\mongodb\bin\mongod.exe" --remove
...

This file was deleted.

7 changes: 6 additions & 1 deletion source/tutorial/install-mongodb-enterprise-on-windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Run MongoDB Enterprise

.. include:: /includes/steps/run-mongodb-on-windows.rst

Configure a Windows Service for MongoDB Enterprise
--------------------------------------------------

.. include:: /includes/steps/configure-windows-service-for-mongodb.rst

.. _manually-create-windows-service-enterprise:

Manually Create a Windows Service for MongoDB Enterprise
Expand All @@ -69,4 +74,4 @@ The following procedure assumes you have installed MongoDB using the
If you have installed in an alternative directory, you will need to
adjust the paths as appropriate.

.. include:: /includes/steps/create-manually-windows-service-for-mongodb-enterprise.rst
.. include:: /includes/steps/create-manually-windows-service-for-mongodb.rst
5 changes: 5 additions & 0 deletions source/tutorial/install-mongodb-on-windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ Run MongoDB

.. _manually-create-windows-service:

Configure a Windows Service for MongoDB
---------------------------------------

.. include:: /includes/steps/configure-windows-service-for-mongodb.rst

Manually Create a Windows Service for MongoDB
---------------------------------------------

Expand Down