Skip to content

DOCS-5665, DOCS-5782, DOCS-6898, DOCS-7445: platform-specific considerations #2620

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
57 changes: 37 additions & 20 deletions source/administration/production-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -492,20 +492,23 @@ When running MongoDB in production on Linux, you should use Linux
kernel version 2.6.36 or later, with either the XFS or EXT4 filesystem.
If possible, use XFS as it generally performs better with MongoDB.

With the WiredTiger storage engine in particular, use of XFS is
**strongly recommended** to avoid performance issues that have been
observed when using EXT4 with WiredTiger.
With the :ref:`WiredTiger storage engine <storage-wiredtiger>`, use of
XFS is **strongly recommended** to avoid performance issues that may
occur when using EXT4 with WiredTiger.

- If you use the XFS file system, use at least version
With the :ref:`MMAPv1 storage engine <storage-mmapv1>`, MongoDB
preallocates its database files before using them and often creates
large files. As such, you should use the XFS or EXT4 file systems. If
possible, use XFS as it generally performs better with MongoDB.

- In general, if you use the XFS file system, use at least version
``2.6.25`` of the Linux Kernel.

.. Required for fallocate()

- If you use the EXT4 file system, use at least version
``2.6.28`` of the Linux Kernel.

.. Initial stable release

- On Red Hat Enterprise Linux and CentOS, use at least version
``2.6.18-194`` of the Linux kernel.

Expand All @@ -522,31 +525,43 @@ observed when using EXT4 with WiredTiger.
Recommended Configuration
`````````````````````````

For the WiredTiger and MMAPv1 storage engines,
For **all** MongoDB deployments:

- Use the Network Time Protocol (NTP) to synchronize time among
your hosts. This is especially important in sharded clusters.

For the **WiredTiger and MMAPv1** storage engines,
consider the following recommendations:

- Turn off ``atime`` for the storage volume containing the :term:`database
files <dbpath>`.

- Set the file descriptor limit, ``-n``, and the user process limit
(ulimit), ``-u``, above 20,000, according to the suggestions in the
:doc:`ulimit </reference/ulimit>` document. A low ulimit will affect
:doc:`ulimit </reference/ulimit>` reference. A low ulimit will affect
MongoDB when under heavy use and can produce errors and lead to
failed connections to MongoDB processes and loss of service.

- Disable Transparent Huge Pages, as MongoDB performs better with
- Disable Transparent Huge Pages. MongoDB performs better with
normal (4096 bytes) virtual memory pages. See :doc:`Transparent Huge
Pages Settings </tutorial/transparent-huge-pages>`.

- Disable NUMA in your BIOS. If that is not possible, see
:ref:`MongoDB on NUMA Hardware <production-numa>`.

- Configure SELinux on Red Hat. For more information, see
- Problems have been reported when using MongoDB with SELinux enabled.
To avoid issues, disable SELinux when possible.

If you are using SELinux on Red Hat, you must configure SELinux
to be able to run MongoDB. See:
:ref:`Configure SELinux for MongoDB <install-rhel-configure-selinux>`
and :ref:`Configure SELinux for MongoDB Enterprise
<install-enterprise-rhel-configure-selinux>`.
<install-enterprise-rhel-configure-selinux>` for the required
configuration.

.. include:: /includes/fact-selinux-server-side-js.rst

For the MMAPv1 storage engine:
For the **MMAPv1** storage engine:

.. _readahead:

Expand All @@ -559,11 +574,6 @@ For the MMAPv1 storage engine:
<device>`` to change the readahead settings. Refer to your specific
operating system manual for more information.

For **all** MongoDB deployments:

- Use the Network Time Protocol (NTP) to synchronize time among
your hosts. This is especially important in sharded clusters.

MongoDB and TLS/SSL Libraries
`````````````````````````````

Expand Down Expand Up @@ -680,11 +690,18 @@ instances directly from |MMS|. See :mms-docs:`Configure AWS Integration
Azure
`````

For all MongoDB deployments using Azure, you **must** mount the volume
Use `Premium Storage
<https://azure.microsoft.com/en-us/documentation/articles/storage-premium-storage/>`_.
Microsoft Azure offers two general types of storage:
Standard storage, and Premium storage. MongoDB on Azure has better
performance when using Premium storage than it does with Standard
storage.

For all :ref:`MMAPv1 <storage-mmapv1>` MongoDB deployments using Azure,
you **must** mount the volume
that hosts the :program:`mongod` instance's :setting:`~storage.dbPath`
with the *Host Cache Preference* ``READ/WRITE``.

This applies to all Azure deployments, using any guest operating
This applies to all Azure deployments running MMAPv1, using any guest operating
system.

If your volumes have inappropriate cache settings, MongoDB may
Expand Down
2 changes: 2 additions & 0 deletions source/core/server-side-javascript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ run on the server. For more information, see
You can also disable server-side execution of JavaScript. For details,
see :ref:`disable-server-side-js`.

.. include:: /includes/fact-selinux-server-side-js.rst

.. _running-js-scripts-in-mongo-on-mongod-host:

Running ``.js`` files via a ``mongo`` shell Instance on the Server
Expand Down
42 changes: 19 additions & 23 deletions source/includes/fact-selinux-redhat-options.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
.. important::

You must configure SELinux to allow MongoDB to start on Red Hat
Linux-based systems (Red Hat Enterprise Linux or CentOS Linux).
If you are using SELinux, you must configure SELinux to allow
MongoDB to start on Red Hat Linux-based systems (Red Hat Enterprise
Linux or CentOS Linux).

To configure SELinux, administrators have three options:

.. note::
- If SELinux is in ``enforcing`` mode,
enable access to the relevant ports that the MongoDB deployment will use
(e.g. ``27017``). See :doc:`/reference/default-mongodb-port` for
more information on MongoDB's default ports. For default settings,
this can be accomplished by running

.. code-block:: sh

All three options require ``root`` privileges. The first two options
each requires a system reboot and may have larger implications for
your deployment.
semanage port -a -t mongod_port_t -p tcp 27017

- Disable SELinux entirely by changing the ``SELINUX`` setting to
- Disable SELinux by setting the ``SELINUX`` setting to
``disabled`` in ``/etc/selinux/config``.

.. code-block:: sh

SELINUX=disabled

You must reboot the system for the changes to take effect.

- Set SELinux to ``permissive`` mode in ``/etc/selinux/config`` by
changing the ``SELINUX`` setting to ``permissive`` .
setting the ``SELINUX`` setting to ``permissive``.

.. code-block:: sh

SELINUX=permissive

.. note::

You can use ``setenforce`` to change to permissive mode; this
method does not require a reboot but is **not** persistent.

- Enable access to the relevant ports (e.g. 27017) for SELinux if in
``enforcing`` mode. See :doc:`/reference/default-mongodb-port` for
more information on MongoDB's default ports. For default settings,
this can be accomplished by running

.. code-block:: sh

semanage port -a -t mongod_port_t -p tcp 27017
You must reboot the system for the changes to take effect.

.. include:: /includes/warning-selinux-rhel7.rst
You can instead use ``setenforce`` to change to ``permissive`` mode.
``setenforce`` does not require a reboot but is **not** persistent.

You may alternatively choose not to install the SELinux packages when you are
Alternatively, you can choose not to install the SELinux packages when you are
installing your Linux operating system, or choose to remove the relevant
packages. This option is the most invasive and is not recommended.
6 changes: 6 additions & 0 deletions source/includes/fact-selinux-server-side-js.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. note::

If you are using SELinux, any MongoDB operation that requires
:doc:`server-side JavaScript </core/server-side-javascript>` will
result in segfault errors. :ref:`disable-server-side-js` describes
how to disable execution of server-side JavaScript.