-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathmongod.txt
2842 lines (1750 loc) · 94.7 KB
/
mongod.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.. _mongod:
==========
``mongod``
==========
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
Synopsis
--------
:binary:`~bin.mongod` is the primary daemon process for the MongoDB
system. It handles data requests, manages data access, and performs
background management operations.
This document provides a complete overview of all command line options
for :binary:`~bin.mongod`. These command line options are primarily useful
for testing: In common operation, use the :doc:`configuration file
options </reference/configuration-options>` to control the behavior of
your database.
.. seealso:: :ref:`conf-file-command-line-mapping`
.. note::
.. include:: /includes/fact-tls-1.0.rst
.. |binary| replace:: MongoDB
.. _mongod-options:
Options
-------
.. only:: (not man)
.. class:: hidden
.. binary:: mongod
Core Options
~~~~~~~~~~~~
.. program:: mongod
.. option:: --help, -h
Returns information on the options and use of :program:`mongod`.
.. option:: --version
Returns the :program:`mongod` release number.
.. option:: --config <filename>, -f <filename>
Specifies a configuration file for runtime configuration options. The
configuration file is the preferred method for runtime configuration of
:program:`mongod`. The options are equivalent to the command-line
configuration options. See :doc:`/reference/configuration-options` for
more information.
Ensure the configuration file uses ASCII encoding. The :program:`mongod`
instance does not support configuration files with non-ASCII encoding,
including UTF-8.
.. option:: --verbose, -v
Increases the amount of internal reporting returned on standard output
or in log files. Increase the verbosity with the ``-v`` form by
including the option multiple times, (e.g. ``-vvvvv``.)
.. option:: --quiet
Runs :program:`mongod` in a quiet mode that attempts to limit the amount
of output.
This option suppresses:
- output from :term:`database commands <database command>`
- replication activity
- connection accepted events
- connection closed events
.. option:: --port <port>
*Default*:
- 27017 if :binary:`~bin.mongod` is not a shard member or a config server member
- 27018 if :binary:`~bin.mongod` is a :option:`shard member <mongod --shardsvr>`
- 27019 if :binary:`~bin.mongod` is a :option:`config server member <mongod --configsvr>`
The TCP port on which the MongoDB instance listens for
client connections.
.. option:: --bind_ip <hostnames|ipaddresses|Unix domain socket paths>
*Default*: localhost
.. note::
Starting in MongoDB 3.6, :program:`mongod` bind to localhost
by default. See :ref:`3.6-bind-to-localhost`.
The hostnames and/or IP addresses and/or full Unix domain socket
paths on which :program:`mongod` should listen for client connections. You
may attach :program:`mongod` to any interface. To bind to multiple
addresses, enter a list of comma-separated values.
.. example:: ``localhost,/tmp/mongod.sock``
You can specify both IPv4 and IPv6 addresses, or hostnames that
resolve to an IPv4 or IPv6 address.
.. example:: ``localhost, 2001:0DB8:e132:ba26:0d5c:2774:e7f9:d513``
.. note::
If specifying an IPv6 address *or* a hostname that resolves to an
IPv6 address to :option:`--bind_ip`, you must start :program:`mongod` with
:option:`--ipv6` to enable IPv6 support. Specifying an IPv6 address
to :option:`--bind_ip` does not enable IPv6 support.
If specifying a
`link-local IPv6 address <https://en.wikipedia.org/w/index.php?title=Link-local_address&oldid=880793020#IPv6>`_
(``fe80::/10``), you must append the
`zone index <https://en.wikipedia.org/w/index.php?title=IPv6_address&oldid=877601778#Scoped_literal_IPv6_addresses>`_
to that address (i.e. ``fe80::<address>%<adapter-name>``).
.. example:: ``localhost,fe80::a00:27ff:fee0:1fcf%enp0s3``
.. include:: /includes/tip-hostnames.rst
.. include:: /includes/warning-bind-ip-security-considerations.rst
For more information about IP Binding, refer to the
:doc:`/core/security-mongodb-configuration` documentation.
To bind to all IPv4 addresses, enter ``0.0.0.0``.
To bind to all IPv4 and IPv6 addresses, enter ``::,0.0.0.0``
or alternatively, use the :setting:`net.bindIpAll` setting.
.. note::
``--bind_ip`` and ``--bind_ip_all`` are mutually exclusive.
Specifying both options causes :program:`mongod` to throw an error and
terminate.
.. option:: --bind_ip_all
.. versionadded:: 3.6
If specified, the :program:`mongod` instance binds to all IPv4
addresses (i.e. ``0.0.0.0``). If :program:`mongod` starts with
:option:`--ipv6`, :option:`--bind_ip_all` also binds to all IPv6 addresses
(i.e. ``::``).
:program:`mongod` only supports IPv6 if started with :option:`--ipv6`. Specifying
:option:`--bind_ip_all` alone does not enable IPv6 support.
.. include:: /includes/warning-bind-ip-security-considerations.rst
For more information about IP Binding, refer to the
:doc:`/core/security-mongodb-configuration` documentation.
Alternatively, you can set the ``--bind_ip`` option to
``::,0.0.0.0`` to bind to all IP addresses.
.. note::
``--bind_ip`` and ``--bind_ip_all`` are mutually exclusive. That
is, you can specify one or the other, but not both.
.. option:: --clusterIpSourceWhitelist <string>
.. versionadded:: 3.6
A list of IP addresses/CIDR (`Classless Inter-Domain Routing
<https://tools.ietf.org/html/rfc4632>`__) ranges against which the
:binary:`~bin.mongod` validates authentication requests from other members of
the replica set and, if part of a sharded cluster, the :binary:`~bin.mongos`
instances. The :binary:`~bin.mongod` verifies that the originating IP is
either explicitly in the list or belongs to a CIDR range in the list. If the
IP address is not present, the server does not authenticate the
:binary:`~bin.mongod` or :binary:`~bin.mongos`.
:option:`--clusterIpSourceWhitelist` has no effect on a :binary:`~bin.mongod` started without
:ref:`authentication <authentication>`.
:option:`--clusterIpSourceWhitelist` accepts multiple comma-separated IPv4/6 addresses or Classless
Inter-Domain Routing (`CIDR <https://tools.ietf.org/html/rfc4632>`_) ranges:
.. code-block:: shell
mongod --clusterIpSourceWhitelist 192.0.2.0/24,127.0.0.1,::1
.. important::
Ensure :option:`--clusterIpSourceWhitelist` includes the IP address *or* CIDR ranges that include the
IP address of each replica set member or :binary:`~bin.mongos` in the
deployment to ensure healthy communication between cluster components.
.. option:: --ipv6
Enables IPv6 support. :program:`mongod` disables IPv6 support by default.
Setting :option:`--ipv6` does *not* direct the :program:`mongod` to listen on any
local IPv6 addresses or interfaces. To configure the :program:`mongod` to
listen on an IPv6 interface, you must either:
- Configure :option:`--bind_ip` with one or more IPv6 addresses or
hostnames that resolve to IPv6 addresses, **or**
- Set :option:`--bind_ip_all` to ``true``.
.. option:: --listenBacklog <number>
*Default*: Target system ``SOMAXCONN`` constant
.. versionadded:: 3.6
The maximum number of connections that can exist in the listen
queue.
.. warning ::
Consult your local system's documentation to understand the
limitations and configuration requirements before using this
parameter.
.. important::
To prevent undefined behavior, specify a value for this
parameter between ``1`` and the local system ``SOMAXCONN``
constant.
The default value for the ``listenBacklog`` parameter is set at
compile time to the target system ``SOMAXCONN`` constant.
``SOMAXCONN`` is the maximum valid value that is documented for
the *backlog* parameter to the *listen* system call.
Some systems may interpret ``SOMAXCONN`` symbolically, and others
numerically. The actual *listen backlog* applied in practice may
differ from any numeric interpretation of the ``SOMAXCONN`` constant
or argument to ``--listenBacklog``, and may also be constrained by
system settings like ``net.core.somaxconn`` on Linux.
Passing a value for the ``listenBacklog`` parameter that exceeds the
``SOMAXCONN`` constant for the local system is, by the letter of the
standards, undefined behavior. Higher values may be silently integer
truncated, may be ignored, may cause unexpected resource
consumption, or have other adverse consequences.
On systems with workloads that exhibit connection spikes, for which
it is empirically known that the local system can honor higher
values for the *backlog* parameter than the ``SOMAXCONN`` constant,
setting the ``listenBacklog`` parameter to a higher value may reduce
operation latency as observed by the client by reducing the number
of connections which are forced into a backoff state.
.. option:: --maxConns <number>
The maximum number of simultaneous connections that :program:`mongod` will
accept. This setting has no effect if it is higher than your operating
system's configured maximum connection tracking threshold.
Do not assign too low of a value to this option, or you will
encounter errors during normal application operation.
.. include:: /includes/note-max-conns-max.rst
.. option:: --logpath <path>
Sends all diagnostic logging information to a log file instead of to
standard output or to the host's :term:`syslog` system. MongoDB creates
the log file at the path you specify.
By default, MongoDB will move any existing log file rather than overwrite
it. To instead append to the log file, set the :option:`--logappend` option.
.. option:: --syslog
Sends all logging output to the host's :term:`syslog` system rather
than to standard output or to a log file. , as with :option:`--logpath`.
The :option:`--syslog` option is not supported on Windows.
.. warning::
The ``syslog`` daemon generates timestamps when it logs a message, not
when MongoDB issues the message. This can lead to misleading timestamps
for log entries, especially when the system is under heavy load. We
recommend using the :option:`--logpath` option for production systems to
ensure accurate timestamps.
.. option:: --syslogFacility <string>
*Default*: user
Specifies the facility level used when logging messages to syslog.
The value you specify must be supported by your
operating system's implementation of syslog. To use this option, you
must enable the :option:`--syslog` option.
.. option:: --logappend
Appends new entries to the end of the existing log file when the :program:`mongod`
instance restarts. Without this option, :binary:`~bin.mongod` will back up the
existing log and create a new file.
.. option:: --logRotate <string>
*Default*: rename
.. versionadded:: 3.0.0
Determines the behavior for the :dbcommand:`logRotate` command.
Specify either ``rename`` or ``reopen``:
- ``rename`` renames the log file.
- ``reopen`` closes and reopens the log file following the typical
Linux/Unix log rotate behavior. Use ``reopen`` when using the
Linux/Unix logrotate utility to avoid log loss.
If you specify ``reopen``, you must also use :option:`--logappend`.
If :doc:`auditing </core/auditing>` is enabled, the
:dbcommand:`logRotate` command also rotates the audit log according
to the above parameters. For example, if :option:`--logRotate` is set
to ``rename``, the audit log will also be renamed.
.. option:: --timeStampFormat <string>
*Default*: iso8601-local
The time format for timestamps in log messages. Specify one of the
following values:
.. list-table::
:header-rows: 1
:widths: 20 40
* - Value
- Description
* - ``ctime``
- Displays timestamps as ``Wed Dec 31
18:17:54.811``.
* - ``iso8601-utc``
- Displays timestamps in Coordinated Universal Time (UTC) in the
ISO-8601 format. For example, for New York at the start of the
Epoch: ``1970-01-01T00:00:00.000Z``
* - ``iso8601-local``
- Displays timestamps in local time in the ISO-8601
format. For example, for New York at the start of the Epoch:
``1969-12-31T19:00:00.000-0500``
.. COMMENT traceExceptions is internal use only and not in mongod help output
.. option:: --traceExceptions
For internal diagnostic use only.
.. see SERVER-6667a
.. option:: --pidfilepath <path>
Specifies a file location to store the process ID (PID) of the :program:`mongod`
process. The user running the ``mongod`` or ``mongos``
process must be able to write to this path. If the :option:`--pidfilepath` option is not
specified, the process does not create a PID file. This option is generally
only useful in combination with the :option:`--fork` option.
.. admonition:: Linux
:class: note
On Linux, PID file management is generally the responsibility of
your distro's init system: usually a service file in the ``/etc/init.d``
directory, or a systemd unit file registered with ``systemctl``. Only
use the :option:`--pidfilepath` option if you are not using one of these init
systems. For more information, please see the respective
:doc:`Installation Guide </installation>` for your operating system.
.. admonition:: macOS
:class: note
On macOS, PID file management is generally handled by ``brew``. Only use
the :option:`--pidfilepath` option if you are not using ``brew`` on your macOS system.
For more information, please see the respective
:doc:`Installation Guide </installation>` for your operating system.
.. option:: --keyFile <file>
Specifies the path to a key file that stores the shared secret
that MongoDB instances use to authenticate to each other in a
:term:`sharded cluster` or :term:`replica set`. :option:`--keyFile` implies
:option:`--auth`. See :ref:`inter-process-auth` for more
information.
.. option:: --setParameter <options>
Specifies one of the MongoDB parameters described in
:doc:`/reference/parameters`. You can specify multiple ``setParameter``
fields.
.. COMMENT clusterAuthMode moved to SSL section
.. option:: --nounixsocket
Disables listening on the UNIX domain socket. :option:`--nounixsocket` applies only
to Unix-based systems.
The :program:`mongod` process
always listens on the UNIX socket unless one of the following is true:
- :option:`--nounixsocket` is set
- :setting:`net.bindIp` is not set
- :setting:`net.bindIp` does not specify ``localhost`` or its associated IP address
.. |mongodb-package| replace:: :program:`mongod`
.. include:: /includes/note-deb-and-rpm-default-to-localhost.rst
.. option:: --unixSocketPrefix <path>
*Default*: /tmp
The path for the UNIX socket. :option:`--unixSocketPrefix` applies only
to Unix-based systems.
If this option has no value, the
:program:`mongod` process creates a socket with ``/tmp`` as a prefix. MongoDB
creates and listens on a UNIX socket unless one of the following is true:
- :setting:`net.unixDomainSocket.enabled` is ``false``
- :option:`--nounixsocket` is set
- :setting:`net.bindIp` is not set
- :setting:`net.bindIp` does not specify ``localhost`` or its associated IP address
.. option:: --filePermissions <path>
*Default*: ``0700``
Sets the permission for the UNIX domain socket file.
:option:`--filePermissions` applies only to Unix-based systems.
.. option:: --fork
Enables a :term:`daemon` mode that runs the :program:`mongod` process in the
background. By default :program:`mongod` does not run as a daemon:
typically you will run :program:`mongod` as a daemon, either by using
:option:`--fork` or by using a controlling process that handles the
daemonization process (e.g. as with ``upstart`` and ``systemd``).
Using the :option:`--fork` option requires that you configure log
output for the :program:`mongod` with one of the following:
- :option:`--logpath`
- :option:`--syslog`
The :option:`--fork` option is not supported on Windows.
.. option:: --auth
Enables authorization to control user's access to database resources
and operations. When authorization is enabled, MongoDB requires all
clients to authenticate themselves first in order to determine the
access for the client.
Configure users via the :doc:`mongo shell
</reference/program/mongo>`. If no users exist, the localhost interface
will continue to have access to the database until you create
the first user.
See :doc:`Security </security>`
for more information.
.. option:: --noauth
Disables authentication. Currently the default. Exists for future
compatibility and clarity.
.. option:: --transitionToAuth
.. versionadded:: 3.4
Allows the :program:`mongod` to accept and create authenticated and
non-authenticated connections to and from other :binary:`~bin.mongod`
and :binary:`~bin.mongos` instances in the deployment. Used for
performing rolling transition of replica sets or sharded clusters
from a no-auth configuration to :ref:`internal authentication
<inter-process-auth>`. Requires specifying a :ref:`internal
authentication <inter-process-auth>` mechanism such as
:option:`--keyFile`.
For example, if using :ref:`keyfiles <internal-auth-keyfile>` for
:ref:`internal authentication <inter-process-auth>`, the :program:`mongod` creates
an authenticated connection with any :binary:`~bin.mongod` or :binary:`~bin.mongos`
in the deployment using a matching keyfile. If the security mechanisms do
not match, the :program:`mongod` utilizes a non-authenticated connection instead.
A :program:`mongod` running with :option:`--transitionToAuth` does not enforce :ref:`user access
controls <authorization>`. Users may connect to your deployment without any
access control checks and perform read, write, and administrative operations.
.. note::
A :program:`mongod` running with :ref:`internal authentication
<inter-process-auth>` and *without* :option:`--transitionToAuth` requires clients to connect
using :ref:`user access controls <authorization>`. Update clients to
connect to the :program:`mongod` using the appropriate :ref:`user <users>`
prior to restarting :program:`mongod` without :option:`--transitionToAuth`.
.. option:: --cpu
Forces the :program:`mongod` process to report the percentage of CPU time in
write lock, every four seconds.
.. option:: --sysinfo
Returns diagnostic system information and then exits. The
information provides the page size, the number of physical pages,
and the number of available physical pages.
.. option:: --noscripting
Disables the scripting engine.
.. option:: --notablescan
Forbids operations that require a collection scan. See :parameter:`notablescan` for additional information.
.. option:: --shutdown
The :option:`--shutdown` option cleanly and safely terminates the :program:`mongod`
process. When invoking :program:`mongod` with this option you must set the
:option:`--dbpath` option either directly or by way of the
:doc:`configuration file </reference/configuration-options>` and the
:option:`--config` option.
The :option:`--shutdown` option is available only on Linux systems.
For additional ways to shut down, see also :ref:`terminate-mongod-processes`.
.. option:: --redactClientLogData
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
A :program:`mongod` running with :option:`--redactClientLogData` redacts any message accompanying a given
log event before logging. This prevents the :program:`mongod` from writing
potentially sensitive data stored on the database to the diagnostic log.
Metadata such as error or operation codes, line numbers, and source file
names are still visible in the logs.
Use :option:`--redactClientLogData` in conjunction with
:doc:`/core/security-encryption-at-rest` and
:doc:`/core/security-transport-encryption` to assist compliance with
regulatory requirements.
For example, a MongoDB deployment might store Personally Identifiable
Information (PII) in one or more collections. The :program:`mongod` logs events
such as those related to CRUD operations, sharding metadata, etc. It is
possible that the :program:`mongod` may expose PII as a part of these logging
operations. A :program:`mongod` running with :option:`--redactClientLogData` removes any message
accompanying these events before being output to the log, effectively
removing the PII.
Diagnostics on a :program:`mongod` running with :option:`--redactClientLogData` may be more difficult
due to the lack of data related to a log event. See the
:ref:`process logging <monitoring-log-redaction>` manual page for an
example of the effect of :option:`--redactClientLogData` on log output.
On a running :program:`mongod`, use :dbcommand:`setParameter` with the
:parameter:`redactClientLogData` parameter to configure this setting.
.. option:: --networkMessageCompressors <string>
*Default*: snappy
.. versionadded:: 3.4
Specifies the default compressor(s) to use for
communication between this :program:`mongod` instance and:
- other members of the deployment if the instance is part of a replica set or a sharded cluster
- a :binary:`~bin.mongo` shell
- drivers that support the ``OP_COMPRESSED`` message format.
MongoDB supports the following compressors:
- :term:`snappy`
- :term:`zlib` (Available in MongoDB 3.6 or greater)
**In versions 3.6 and 4.0**, :binary:`~bin.mongod` and
:binary:`~bin.mongos` enable network compression by default with
``snappy`` as the compressor.
To disable network compression, set the value to ``disabled``.
.. include:: /includes/fact-networkMessageCompressors.rst
.. option:: --timeZoneInfo <path>
.. include:: /includes/fact-timeZoneInfo.rst
.. code-block:: sh
wget https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip
unzip timezonedb-latest.zip
mongod --timeZoneInfo timezonedb-2017b/
.. include:: /includes/warning-timeZoneInfo.rst
.. seealso::
:setting:`processManagement.timeZoneInfo`.
.. option:: --serviceExecutor <string>
*Default*: synchronous
.. versionadded:: 3.6
Determines the threading and execution model :program:`mongod` uses to
execute client requests. The ``--serviceExecutor`` option accepts one
of the following values:
.. list-table::
:header-rows: 1
:widths: 20 40
* - Value
- Description
* - ``synchronous``
- The :program:`mongod` uses synchronous networking and manages its
networking thread pool on a per connection basis. Previous
versions of MongoDB managed threads in this way.
* - ``adaptive``
- The :program:`mongod` uses the new experimental asynchronous
networking mode with an adaptive thread pool which manages
threads on a per request basis. This mode should have more
consistent performance and use less resources when there are
more inactive connections than database requests.
Free Monitoring
~~~~~~~~~~~~~~~
.. versionadded:: 4.0
.. option:: --enableFreeMonitoring <runtime|on|off>
.. versionadded:: 4.0
Available for MongoDB Community Edition.
Enables or disables :doc:`free MongoDB Cloud monitoring
</administration/free-monitoring>`. :option:`--enableFreeMonitoring` accepts the following
values:
.. list-table::
:widths: 20 80
* - ``runtime``
- Default. You can enable or disable free monitoring during
runtime.
To enable or disable free monitoring during runtime, see
:method:`db.enableFreeMonitoring()` and
:method:`db.disableFreeMonitoring()`.
To enable or disable free monitoring during runtime when
running with access control, users must have required
privileges. See :method:`db.enableFreeMonitoring()` and
:method:`db.disableFreeMonitoring()` for details.
* - ``on``
- Enables free monitoring at startup; i.e. registers for free
monitoring. When enabled at startup, you cannot disable free
monitoring during runtime.
* - ``off``
- Disables free monitoring at startup, regardless of whether
you have previously registered for free monitoring. When disabled at startup,
you cannot enable free monitoring during runtime.
Once enabled, the free monitoring state remains enabled until
explicitly disabled. That is, you do not need to re-enable each time
you start the server.
For the corresponding configuration file setting, see
:setting:`cloud.monitoring.free.state`.
.. option:: --freeMonitoringTag <string>
.. versionadded:: 4.0
Available for MongoDB Community Edition.
Optional tag to describe environment context. The tag can be sent as
part of the :doc:`free MongoDB Cloud monitoring
</administration/free-monitoring>` registration at start up.
For the corresponding configuration file setting, see
:setting:`cloud.monitoring.free.tags`.
LDAP Authentication or Authorization Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. option:: --ldapServers <host1>:<port>,<host2>:<port>,...,<hostN>:<port>
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
The LDAP server against which the :program:`mongod` authenticates users or
determines what actions a user is authorized to perform on a given
database. If the LDAP server specified has any replicated instances,
you may specify the host and port of each replicated server in a
comma-delimited list.
If your LDAP infrastructure partitions the LDAP directory over multiple LDAP
servers, specify *one* LDAP server or any of its replicated instances to
:option:`--ldapServers`. MongoDB supports following LDAP referrals as defined in `RFC 4511
4.1.10 <https://www.rfc-editor.org/rfc/rfc4511.txt>`_. Do not use :option:`--ldapServers`
for listing every LDAP server in your infrastructure.
This setting can be configured on a running :program:`mongod` using
:dbcommand:`setParameter`.
If unset, :program:`mongod` cannot use :doc:`LDAP authentication or authorization
</core/security-ldap>`.
.. option:: --ldapValidateLDAPServerConfig <boolean>
*Available in MongoDB Enterprise*
A flag that determines if the :binary:`~bin.mongod` instance checks
the availability of the :option:`LDAP server(s)
<mongod --ldapServers>` as part of its startup:
- If ``true``, the :binary:`~bin.mongod` instance performs the
availability check and only continues to start up if the LDAP
server is available.
- If ``false``, the :binary:`~bin.mongod` instance skips the
availability check; i.e. the instance starts up even if the LDAP
server is unavailable.
.. option:: --ldapQueryUser <string>
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
The identity with which :program:`mongod` binds as, when connecting to or
performing queries on an LDAP server.
Only required if any of the following are true:
- Using :ref:`LDAP authorization <security-ldap-external>`.
- Using an LDAP query for :option:`username transformation <--ldapUserToDNMapping>`.
- The LDAP server disallows anonymous binds
You must use :option:`--ldapQueryUser` with :option:`--ldapQueryPassword`.
If unset, :program:`mongod` will not attempt to bind to the LDAP server.
This setting can be configured on a running :program:`mongod` using
:dbcommand:`setParameter`.
.. note::
Windows MongoDB deployments can use :option:`--ldapBindWithOSDefaults`
instead of :option:`--ldapQueryUser` and :option:`--ldapQueryPassword`. You cannot specify
both :option:`--ldapQueryUser` and :option:`--ldapBindWithOSDefaults` at the same time.
.. option:: --ldapQueryPassword <string>
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
The password used to bind to an LDAP server when using
:option:`--ldapQueryUser`. You must use :option:`--ldapQueryPassword` with
:option:`--ldapQueryUser`.
If unset, :program:`mongod` will not attempt to bind to the LDAP server.
This setting can be configured on a running :program:`mongod` using
:dbcommand:`setParameter`.
.. note::
Windows MongoDB deployments can use :option:`--ldapBindWithOSDefaults`
instead of :option:`--ldapQueryPassword` and :option:`--ldapQueryPassword`. You cannot specify
both :option:`--ldapQueryPassword` and :option:`--ldapBindWithOSDefaults` at the same time.
.. option:: --ldapBindWithOSDefaults <bool>
*Default*: false
.. versionadded:: 3.4
Available in MongoDB Enterprise for the Windows platform only.
Allows :program:`mongod` to authenticate, or bind, using your Windows login
credentials when connecting to the LDAP server.
Only required if:
- Using :ref:`LDAP authorization <security-ldap-external>`.
- Using an LDAP query for :option:`username transformation <--ldapUserToDNMapping>`.
- The LDAP server disallows anonymous binds
Use :option:`--ldapBindWithOSDefaults` to replace :option:`--ldapQueryUser` and
:option:`--ldapQueryPassword`.
.. option:: --ldapBindMethod <string>
*Default*: simple
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
The method :program:`mongod` uses to authenticate to an LDAP server.
Use with :option:`--ldapQueryUser` and :option:`--ldapQueryPassword` to
connect to the LDAP server.
:option:`--ldapBindMethod` supports the following values:
* ``simple`` - :program:`mongod` uses simple authentication.
* ``sasl`` - :program:`mongod` uses SASL protocol for authentication
If you specify ``sasl``, you can configure the available SASL mechanisms
using :option:`--ldapBindSaslMechanisms`. :program:`mongod` defaults to
using ``DIGEST-MD5`` mechanism.
.. option:: --ldapBindSaslMechanisms <string>
*Default*: DIGEST-MD5
.. versionadded:: 3.4 Available in MongoDB Enterprise only.
A comma-separated list of SASL mechanisms :program:`mongod` can
use when authenticating to the LDAP server. The :program:`mongod` and the
LDAP server must agree on at least one mechanism. The :program:`mongod`
dynamically loads any SASL mechanism libraries installed on the host
machine at runtime.
Install and configure the appropriate libraries for the selected
SASL mechanism(s) on both the :program:`mongod` host and the remote
LDAP server host. Your operating system may include certain SASL
libraries by default. Defer to the documentation associated with each
SASL mechanism for guidance on installation and configuration.
If using the ``GSSAPI`` SASL mechanism for use with
:ref:`security-kerberos`, verify the following for the
:program:`mongod` host machine:
``Linux``
- The ``KRB5_CLIENT_KTNAME`` environment
variable resolves to the name of the client :ref:`keytab-files`
for the host machine. For more on Kerberos environment
variables, please defer to the
`Kerberos documentation <https://web.mit.edu/kerberos/krb5-1.13/doc/admin/env_variables.html>`__.
- The client keytab includes a
:ref:`kerberos-user-principal` for the :program:`mongod` to use when
connecting to the LDAP server and execute LDAP queries.
``Windows``
If connecting to an Active Directory server, the Windows
Kerberos configuration automatically generates a
`Ticket-Granting-Ticket <https://msdn.microsoft.com/en-us/library/windows/desktop/aa380510(v=vs.85).aspx>`__
when the user logs onto the system. Set :option:`--ldapBindWithOSDefaults` to
``true`` to allow :program:`mongod` to use the generated credentials when
connecting to the Active Directory server and execute queries.
Set :option:`--ldapBindMethod` to ``sasl`` to use this option.
.. note::
For a complete list of SASL mechanisms see the
`IANA listing
<http://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml>`_.
Defer to the documentation for your LDAP or Active Directory
service for identifying the SASL mechanisms compatible with the
service.
MongoDB is not a source of SASL mechanism libraries, nor
is the MongoDB documentation a definitive source for
installing or configuring any given SASL mechanism. For
documentation and support, defer to the SASL mechanism
library vendor or owner.
For more information on SASL, defer to the following resources: