From 4052ac7cb0043ca59b8e77a25da0c1909d2eb2a0 Mon Sep 17 00:00:00 2001 From: Andrew Feierabend Date: Thu, 21 Jan 2021 12:53:12 -0500 Subject: [PATCH] DOCS-14143,DOCSP-8696,DOCSP-14087 macOS brew conf file location apple silicon --- source/administration/configuration.txt | 19 +---- source/includes/fact-default-conf-file.rst | 33 +++++++++ source/reference/configuration-options.txt | 12 +-- source/tutorial/install-mongodb-on-os-x.txt | 81 +++++++++++++-------- 4 files changed, 88 insertions(+), 57 deletions(-) create mode 100644 source/includes/fact-default-conf-file.rst diff --git a/source/administration/configuration.txt b/source/administration/configuration.txt index 063ee0c438d..1b2f852da56 100644 --- a/source/administration/configuration.txt +++ b/source/administration/configuration.txt @@ -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 ` 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:`/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 @@ -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 ` or :option:`-f ` -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: diff --git a/source/includes/fact-default-conf-file.rst b/source/includes/fact-default-conf-file.rst new file mode 100644 index 00000000000..05c8b55c179 --- /dev/null +++ b/source/includes/fact-default-conf-file.rst @@ -0,0 +1,33 @@ +- If you :doc:`installed MongoDB ` 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 + ` 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 + `__) + + * - Windows + - MSI Installer + - ``\bin\mongod.cfg`` + +- If you :doc:`installed MongoDB ` via a downloaded + ``TGZ`` or ``ZIP`` file, you will need to create your own configuration + file. The :ref:`basic example configuration ` is a good + place to start. diff --git a/source/reference/configuration-options.txt b/source/reference/configuration-options.txt index 0fd1f0cbe86..55d95c62aaa 100644 --- a/source/reference/configuration-options.txt +++ b/source/reference/configuration-options.txt @@ -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:`/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 ~~~~~~~~~~~ diff --git a/source/tutorial/install-mongodb-on-os-x.txt b/source/tutorial/install-mongodb-on-os-x.txt index 1a3dd8583ae..8845714f585 100644 --- a/source/tutorial/install-mongodb-on-os-x.txt +++ b/source/tutorial/install-mongodb-on-os-x.txt @@ -85,38 +85,26 @@ macOS does not include the Homebrew ``brew`` package by default. - Install ``brew`` using the official `Homebrew installation instructions `_. -Tap the MongoDB Homebrew Tap -```````````````````````````` - -Tap the -`MongoDB Homebrew Tap `_ 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 ` above before proceeding. -#. Verify that your system meets all the - :ref:`installation prerequisites ` by running the +#. Tap the `MongoDB Homebrew Tap + `_ 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: @@ -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 ` - (``/usr/local/etc/mongod.conf``) +.. list-table:: + :header-rows: 1 + :widths: 20 30 30 -- the :setting:`log directory path ` - (``/usr/local/var/log/mongodb``) + * - + - Intel Processor + - Apple M1 Processor -- the :setting:`data directory path ` - (``/usr/local/var/mongodb``) + * - :doc:`configuration file ` + - ``/usr/local/etc/mongod.conf`` + - ``/opt/homebrew/etc/mongod.conf`` + + * - :setting:`log directory ` + - ``/usr/local/var/log/mongodb`` + - ``/opt/homebrew/var/log/mongodb`` + + * - :setting:`data directory ` + - ``/usr/local/var/mongodb`` + - ``/opt/homebrew/var/mongodb`` + +See `Apple's documentation `__ +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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -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 + `__: + + .. 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 ` to this file as well.