Skip to content

DOCS-14143,DOCSP-8696,DOCSP-14087 macOS brew conf file location apple… #4889

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

Merged
merged 1 commit into from
Feb 5, 2021
Merged
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
19 changes: 4 additions & 15 deletions source/administration/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,9 @@ best-practice configurations for common use cases.

While both interfaces provide access to the same collection of options
and settings, this document primarily uses the configuration file
interface. If you installed MongoDB with a package manager such as
``yum`` or ``apt`` on Linux, or ``brew`` on macOS, a default
:doc:`configuration file </reference/configuration-options>` has been
provided as part of your installation:
interface.

- On Linux, a default :file:`/etc/mongod.conf` configuration file is
included when using a package manager to install MongoDB.

- On Windows, a default :file:`<install directory>/bin/mongod.cfg`
configuration file is included during the installation.

- On macOS, a default :file:`/usr/local/etc/mongod.conf`
configuration file is included when installing from MongoDB's
official Homebrew tap.
.. include:: /includes/fact-default-conf-file.rst

For package installations of MongoDB on Linux or macOS, an
initialization script which uses this default configuration file is also
Expand Down Expand Up @@ -67,14 +56,14 @@ to create your own configuration file. A
this document. Once you have created a configuration file, you can start
a MongoDB instance with this configuration file by using either the
:option:`--config <mongod --config>` or :option:`-f <mongod --config>`
options to :binary:`~bin.mongod`:
options to :binary:`~bin.mongod`. For example, on Linux:

.. code-block:: sh

mongod --config /etc/mongod.conf
mongod -f /etc/mongod.conf

Modify the values in the ``/etc/mongod.conf`` file on your system to
Modify the values in the ``mongod.conf`` file on your system to
control the configuration of your database instance.

.. _base-config:
Expand Down
33 changes: 33 additions & 0 deletions source/includes/fact-default-conf-file.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- If you :doc:`installed MongoDB </installation>` with a package manager
such as ``yum`` or ``apt`` on Linux or ``brew`` on macOS, or with the
MSI installer on Windows, a default :doc:`configuration file
</reference/configuration-options>` has been provided as part of your
installation:

.. list-table::
:header-rows: 1
:widths: 10 25 65

* - Platform
- Method
- Configuration File

* - Linux
- ``apt``, ``yum``, or ``zypper`` Package Manager
- ``/etc/mongod.conf``

* - macOS
- ``brew`` Package Manager
- ``/usr/local/etc/mongod.conf`` (on Intel processors), or

``/opt/homebrew/etc/mongod.conf`` (on `Apple M1 processors
<https://support.apple.com/en-us/HT211814>`__)

* - Windows
- MSI Installer
- ``<install directory>\bin\mongod.cfg``

- If you :doc:`installed MongoDB </installation>` via a downloaded
``TGZ`` or ``ZIP`` file, you will need to create your own configuration
file. The :ref:`basic example configuration <base-config>` is a good
place to start.
12 changes: 1 addition & 11 deletions source/reference/configuration-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,7 @@ Using a configuration file makes managing :binary:`~bin.mongod` and
deployments. You can also add comments to the configuration file to
explain the server's settings.

.. admonition:: Default Configuration File
:class: note

- On Linux, a default :file:`/etc/mongod.conf` configuration file is
included when using a package manager to install MongoDB.

- On Windows, a default :file:`<install directory>/bin/mongod.cfg`
configuration file is included during the installation.

- On macOS, a default :file:`/usr/local/etc/mongod.conf` configuration
file is included when installing from MongoDB's official Homebrew tap.
.. include:: /includes/fact-default-conf-file.rst

File Format
~~~~~~~~~~~
Expand Down
81 changes: 50 additions & 31 deletions source/tutorial/install-mongodb-on-os-x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,38 +85,26 @@ macOS does not include the Homebrew ``brew`` package by default.
- Install ``brew`` using the official
`Homebrew installation instructions <https://brew.sh/#install>`_.

Tap the MongoDB Homebrew Tap
````````````````````````````

Tap the
`MongoDB Homebrew Tap <https://github.com/mongodb/homebrew-brew>`_ to
download the official Homebrew formulae for MongoDB and the Database
Tools.

- Run the following command in your macOS Terminal:

.. code-block:: sh

brew tap mongodb/brew

.. _install:

Installing MongoDB {+version+} |edition| Edition
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Follow these steps to install MongoDB |edition| Edition using
Homebrew's ``brew`` package manager.
Follow these steps to install MongoDB |edition| Edition using Homebrew's
``brew`` package manager. Be sure that you have followed the
:ref:`installation prerequisites <osx-prereq>` above before proceeding.

#. Verify that your system meets all the
:ref:`installation prerequisites <osx-prereq>` by running the
#. Tap the `MongoDB Homebrew Tap
<https://github.com/mongodb/homebrew-brew>`_ to download the official
Homebrew formula for MongoDB and the Database Tools, by running the
following command in your macOS Terminal:

.. code-block:: sh

brew tap | grep mongodb
brew tap mongodb/brew

You should see the MongoDB brew tap listed. If you do not, or you
receive an error, return to the :ref:`osx-prereq` section.
If you have already done this for a previous installation of MongoDB,
you can skip this step.

#. To install MongoDB, run the following command in your macOS Terminal
application:
Expand All @@ -141,16 +129,38 @@ The installation includes the following binaries:
- The :binary:`~bin.mongos` sharded cluster query router
- The :binary:`~bin.mongo` shell

In addition, the installation creates:
In addition, the installation creates the following files and
directories at the location specified below, depending on your Apple
hardware:

- the :doc:`configuration file </reference/configuration-options>`
(``/usr/local/etc/mongod.conf``)
.. list-table::
:header-rows: 1
:widths: 20 30 30

- the :setting:`log directory path <systemLog.path>`
(``/usr/local/var/log/mongodb``)
* -
- Intel Processor
- Apple M1 Processor

- the :setting:`data directory path <storage.dbPath>`
(``/usr/local/var/mongodb``)
* - :doc:`configuration file </reference/configuration-options>`
- ``/usr/local/etc/mongod.conf``
- ``/opt/homebrew/etc/mongod.conf``

* - :setting:`log directory <systemLog.path>`
- ``/usr/local/var/log/mongodb``
- ``/opt/homebrew/var/log/mongodb``

* - :setting:`data directory <storage.dbPath>`
- ``/usr/local/var/mongodb``
- ``/opt/homebrew/var/mongodb``

See `Apple's documentation <https://support.apple.com/en-us/HT211814>`__
for the current list of Apple hardware using the M1 processor. You can
also run the following command to check where ``brew`` has installed
these files and directories:

.. code-block:: sh

brew --prefix

Run MongoDB Community Edition
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -181,15 +191,24 @@ MongoDB as a macOS service, as doing so sets the correct system
- To run MongoDB (i.e. the :binary:`~bin.mongod` process) **manually
as a background process**, issue the following:

.. code-block:: sh
- For macOS running Intel processors:

.. code-block:: sh

mongod --config /usr/local/etc/mongod.conf --fork

- For macOS running on `Apple M1 processors
<https://support.apple.com/en-us/HT211814>`__:

.. code-block:: sh

mongod --config /usr/local/etc/mongod.conf --fork
mongod --config /opt/homebrew/etc/mongod.conf --fork

To stop a :binary:`~bin.mongod` running as a background process,
connect to the :binary:`~bin.mongod` from the :program:`mongo`
shell, and issue the :dbcommand:`shutdown` command as needed.

Both methods use the :file:`/usr/local/etc/mongod.conf` file created
Both methods use the :file:`mongod.conf` file created
during the install. You can add your own MongoDB
:doc:`configuration options </reference/configuration-options>` to
this file as well.
Expand Down